Forum Discussion
masmith004
4 years agoRegular Visitor
Dynamic Index Measure
Hello, I am struggling with the idea of making a dynamic index measure using DAX in Power BI that would depend on multiple filters. For example, I have data that looks like this: If I f...
- 4 years ago
Hi,
I am not sure if I understood your question correctly.
I think it is better to know the sort order of each column, otherwise I suggest having a number column like the attached pbix file, and use RANKX function and ALLSELECTED function to create a index measure like below.
Index measure: = IF ( HASONEVALUE ( Data[Number] ), RANKX ( ALLSELECTED ( Data ), CALCULATE ( SUM ( Data[Number] ) ),, ASC ) )
Jihwan_Kim
4 years agoSuper User
Hi,
I am not sure if I understood your question correctly.
I think it is better to know the sort order of each column, otherwise I suggest having a number column like the attached pbix file, and use RANKX function and ALLSELECTED function to create a index measure like below.
Index measure: =
IF (
HASONEVALUE ( Data[Number] ),
RANKX ( ALLSELECTED ( Data ), CALCULATE ( SUM ( Data[Number] ) ),, ASC )
)masmith004
4 years agoRegular Visitor
Thank you, this is what I needed!