Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi All,
I want a dynamic DAX that can show me sequential numbers for all my records in table KPI.
The table can be filtered using slicers and so the index should change dynamically.
Solved! Go to Solution.
Hi @Anonymous ,
You can try the following measure to show the dynamic index.
RowNum =
CALCULATE (
COUNT ( 'Table'[ID] ),
FILTER (
ALLSELECTED ( 'Table' ),
'Table'[ID] <= MAX ( 'Table'[ID] )
)
)
You can check more details from here.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
You can try the following measure to show the dynamic index.
RowNum =
CALCULATE (
COUNT ( 'Table'[ID] ),
FILTER (
ALLSELECTED ( 'Table' ),
'Table'[ID] <= MAX ( 'Table'[ID] )
)
)
You can check more details from here.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , In case of Dax Index, would be Rank most of the time. Rank can column Rank static and Measure Rank Dynamic. But Measure rank to Dynamic, you can use allselected. Also, measure rank is context-sensitive
City Rank = RANKX(all(Geography[City]),[Sales]) // Work for City both with City ID all city Rank is 1
Geography Rank = RANKX(all(Geography),[Sales]) // Work with both CIty and City ID , both are the lowest level
City and ID Rank = RANKX(all(Geography[City],Geography[City Id]),[Sales])// Work with both CIty and City ID
For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/367415
@Anonymous - If you want a specific solution, paste in some sample data as text.
@Anonymous - It exists, I created it. https://community.powerbi.com/t5/Quick-Measures-Gallery/The-Mythical-DAX-Index/m-p/1093214#M528
There are also techniques using RANKX although they tend to product duplicates. There are mitigation methods using small random numbers to break ties.
User | Count |
---|---|
101 | |
90 | |
80 | |
71 | |
70 |
User | Count |
---|---|
114 | |
98 | |
97 | |
73 | |
72 |