Hi all,
I am trying to figure out how to calculate the following count and median for a data set with recurring rows. What would the measure syntax be to achieve the results on the bottom right of the image? Thanks in advance!
Solved! Go to Solution.
You can create a summarized table
SumTable = SUMMARIZE(Table2, Table2[ProjNbr], "Revenue", MAX(Table2[Revenue]))
For the count, you don't have to create the table explicitly:
Cnt = COUNTROWS ( SUMMARIZE ( Table2, Table2[ProjNbr], "Revenue", MAX ( Table2[Revenue] ) ) )
or
Cnt = COUNTROWS (SumTable)
But for the median I don't think you can avoid creating the table as MEDIAN requires a column name
Mdn = MEDIAN(SumTable[Revenue])
Hope this helps.
David
You can create a summarized table
SumTable = SUMMARIZE(Table2, Table2[ProjNbr], "Revenue", MAX(Table2[Revenue]))
For the count, you don't have to create the table explicitly:
Cnt = COUNTROWS ( SUMMARIZE ( Table2, Table2[ProjNbr], "Revenue", MAX ( Table2[Revenue] ) ) )
or
Cnt = COUNTROWS (SumTable)
But for the median I don't think you can avoid creating the table as MEDIAN requires a column name
Mdn = MEDIAN(SumTable[Revenue])
Hope this helps.
David
Thanks, David. That was extremely helpful!
Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.
Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!
User | Count |
---|---|
220 | |
56 | |
47 | |
44 | |
43 |
User | Count |
---|---|
287 | |
209 | |
79 | |
75 | |
66 |