Forum Discussion
Help with Measure using RANKX and TOPN
- 4 years ago
Hi cfstout,
You may try this solution.
Here are the sample data used.
Create a Measure like this.
TotalSessionsForTop5Properties = VAR Top5_Properties = TOPN ( 5, SUMMARIZE ( 'Table', 'Table'[Property Name], "Num", CALCULATE ( COUNT ( 'Table'[Session ID] ), FILTER ( ALLEXCEPT('Table','Table'[Property Name]), 'Table'[Plan] = SELECTEDVALUE ( 'Table'[Plan] ) && 'Table'[StartDate] = SELECTEDVALUE ( 'Table'[StartDate] ) ) ) ), [Num], DESC ) RETURN SUMX ( Top5_Properties, [Num] )Then, the result looks like this.
Also, attach the pbix file as reference. Hope it helps.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let me know. Thanks a lot!
Best Regards,
Community Support Team _ Caiyun
Hi cfstout,
You may try this solution.
Here are the sample data used.
Create a Measure like this.
TotalSessionsForTop5Properties =
VAR Top5_Properties =
TOPN (
5,
SUMMARIZE (
'Table',
'Table'[Property Name],
"Num",
CALCULATE (
COUNT ( 'Table'[Session ID] ),
FILTER (
ALLEXCEPT('Table','Table'[Property Name]),
'Table'[Plan] = SELECTEDVALUE ( 'Table'[Plan] )
&& 'Table'[StartDate] = SELECTEDVALUE ( 'Table'[StartDate] )
)
)
),
[Num], DESC
)
RETURN
SUMX ( Top5_Properties, [Num] )
Then, the result looks like this.
Also, attach the pbix file as reference. Hope it helps.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let me know. Thanks a lot!
Best Regards,
Community Support Team _ Caiyun