Forum Discussion
SensingFailure
4 years agoFrequent Visitor
Dynamic Category Switching with Ranking Measures
I have a single table with user logon durations that looks as such: User Date Normal Hours Duration After Hours Duration Office 1 Office 2 Office 3 Keith 1/22/22 4.2 2.5 CT/TD CT/TD...
- 4 years ago
Unfortunately, the RANKX function requires specifying the column to be ranked. However, you can use SWITCH in a measure to specify each column:
Normal Use Rank = SWITCH ( TRUE, ISINSCOPE ( Citrix[Office 1] ), RANKX ( ALLSELECTED ( Citrix[Office 1] ), [Total Normal Use],, DESC ), ISINSCOPE ( Citrix[Office 2] ), RANKX ( ALLSELECTED ( Citrix[Office 2] ), [Total Normal Use],, DESC ), ISINSCOPE ( Citrix[Office 3] ), RANKX ( ALLSELECTED ( Citrix[Office 3] ), [Total Normal Use],, DESC ) )Create a fields parameter using the three Office fields:
Office Level = { ("Office 1", NAMEOF('Citrix'[Office 1]), 0), ("Office 2", NAMEOF('Citrix'[Office 2]), 1), ("Office 3", NAMEOF('Citrix'[Office 3]), 2) }Result:
-----
-----
SensingFailure
4 years agoFrequent Visitor
This took care of it wonderfully! Thank you so much! I never knew about the ISINSCOPE function.
DataInsights
4 years agoSuper User
Glad to hear that worked!