dax

The value parameter in DAX function RANKX

萝らか妹 提交于 2020-01-24 21:04:30
问题 Can you explain what is the job of the value parameter in function RANKX? I could not figure out from documentation what it is for:-) RANKX(<table>, <expression>[, <value>[, <order>[, <ties>]]]) Possibly, if you could submit an example how it works. 回答1: Let´s say I have to tables. Withhin this tables I can rank the games by their rating. Like this: I have a rank for the left table Rank Switch = RANKX(ALLSELECTED('Switch'[Game]); CALCULATE(SUM('Switch'[Rating]))) and one for the right table:

Power BI. Matrix two columns under on column

一曲冷凌霜 提交于 2020-01-24 19:24:26
问题 This is the desired layout of the matrix that I need. I need to have two columns under one column: However, I ended up with this(I used different values, so the values might be slightly different.): With the following columns in the matrix fields: This is a sample of the dataset. Total Units sum up columns A and B. The Order column sorts the Status column: STATUS A B Total Units Order ABC 3 0 3 1 DEF 0 6 6 2 ABC 3 2 5 1 ABC 5 6 11 1 GHI 0 4 4 3 ABC 5 3 8 1 DEF 0 9 9 2 How do I get my desired

Optimizing Dax & model for “where date between” type queries

放肆的年华 提交于 2020-01-24 09:46:11
问题 I am building a model to allow reporting on two seperate datasets, for this example we'l say a Students dataset & a Staff dataset. The datasets are pretty seperate and the only real link between the two is Date, so from a model perspective, there is a Students star schema & a Staff Star Schema. The data displayed is snapshot type data, answering questions like: - For a selected date, show all active employees - for a selected date, show all enrolled students This means that when a single date

DAX expression for COUNT of GROUPBY

老子叫甜甜 提交于 2020-01-23 09:51:54
问题 I am new to PowerBI and writing DAX expressions. I have a table with a text column with different values.All I want to do is get the count for each distinct value. It's easily achieved with this SQL but I can't get the right DAX expression for it. select [value],count(*) as TagCount from Tags group by [value] order by TagCount desc Any help? 回答1: You can do something similar in Power BI as follows: SUMMARIZE(Tags, Tags[value], "TagCount", COUNT(Tags[value])) or SUMMARIZECOLUMNS(Tags[value],

DAX expression for COUNT of GROUPBY

半腔热情 提交于 2020-01-23 09:51:10
问题 I am new to PowerBI and writing DAX expressions. I have a table with a text column with different values.All I want to do is get the count for each distinct value. It's easily achieved with this SQL but I can't get the right DAX expression for it. select [value],count(*) as TagCount from Tags group by [value] order by TagCount desc Any help? 回答1: You can do something similar in Power BI as follows: SUMMARIZE(Tags, Tags[value], "TagCount", COUNT(Tags[value])) or SUMMARIZECOLUMNS(Tags[value],

Recursion in DAX

扶醉桌前 提交于 2020-01-21 01:42:27
问题 I don't know if this is even possible, but I'd like to be able to create a calculated column where each row is dependent on the rows above it. A classic example of this is the Fibonacci sequence, where the sequence is defined by the recurrence relationship F(n) = F(n-1) + F(n-2) and seeds F(1) = F(2) = 1 . In table form, Index Fibonacci ---------------- 1 1 2 1 3 2 4 3 5 5 6 8 7 13 8 21 9 34 10 55 ... ... I want to be able to construct the Fibonacci column as a calculated column. Now, I know

DAX Calculate function with and without FILTER

守給你的承諾、 提交于 2020-01-21 01:37:47
问题 What is the difference in results of CALCULATE function if we use it with and without FILTER function. Suppose we have those two measures: Measure1 = CALCULATE([X], 'FactTable'[Color]="Red") Measure2 = CALCULATE([X], FILTER('FactTable', 'FactTable'[Color]="Red") Update. Additional bounty question: Is there a way to modify Measure2 by using other functions, such as ALL , or ALLSELECTED , so that it would return exactly the same results as Measure1 ? Update after bounty I have decided to grant

PowerPivot Hierarchy Detection - Active Projects

廉价感情. 提交于 2020-01-16 20:04:45
问题 Building on Chris Campbell's Article regarding active projects, I'd like to add an extra dimension. My tables reference their own parent matter in a denormalised 2-layer hierarchy. After some calls to the RELATED() function, the main lookup table of projects can look like this: Cases ID | Client | ParentMatterName | MatterName | ClaimAmount | OpenDate | CloseDate 1 | Mr. Smith | ABC Ltd | ABC Ltd | $40,000 | 1 Jan 15 | 4 Aug 15 2 | Mr. Smith | ABC Ltd | John | $0 |20 Jan 15 | 7 Oct 15 3 | Mr.

Calculate Total by specific column, then apply column total to each row

拜拜、爱过 提交于 2020-01-16 16:48:10
问题 I would like to apply the total count('case_id'), while grouping by the Item. This was my previous ask DAX Measure to calculate aggregate data, but group by Case ID. This gave me the total count('case_id') by sub_item. Measure = VAR datesSelection = DATE( YEAR(SELECTEDVALUE('Date Selection'[DateWoTime])) ,MONTH(SELECTEDVALUE('Date Selection'[DateWoTime])) ,DAY(SELECTEDVALUE('Date Selection'[DateWoTime])) ) VAR devicesTotal = CALCULATETABLE ( VALUES ( Outages[Sub_Item] ), ALLSELECTED ( Outages

How to calculate daily percentage over month on month volume?

旧街凉风 提交于 2020-01-16 16:13:13
问题 I am trying to sum the volume based on month and year for certain records in the given data and then for the given month I am trying to calculate the daily percentage arrival in power bi for the record Person A,1/1/2018,Project,100,1 it should be 100/220 Below is the example data: Resource Name,Month,RecordType,Actual,Flag Person A,1/1/2018,Project,100,1 Person A,1/2/2018,Support,40,1 Person A,1/3/2018,Training,50,1 Person A,1/4/2018,Unavailable,30,1 Person A,2/1/2018,Project,80,1 Person A,2