Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
I am trying to display only top 10 in the table and have been looking up to try using TOPN and RANKX.
But i have been having issue with rankx, with it displaying 1 rank across the table.
The table is expected to be filtered by three criteria,
1. main_service
2. direction
3. customer_segment
I have tried using adding columns and it gives me the ranks throughout the entire table. But i am looking for a dynamic ranking where it will be ranked as the filter is applied.
rank = RANKX(ALLSELECTED(summary_table), [total_teus],,0)
rank is using new column with the above code, while rankings, i have been trying with code below.
rankings = CALCULATE(
RANKX(ALLSELECTED(summary_table[od_pairs]), SUM([total_teus]),,0))
Solved! Go to Solution.
@jeanL , Try TOPN like
CALCULATE([total_teus], TOPN(10,ALLSELECTED(summary_table[od_pairs]),[total_teus],dense), ALLSELECTED(summary_table[od_pairs]))
rankings =
RANKX(
ALLSELECTED( summary_table[od_pairs] ),
CALCULATE( SUM( [total_teus] ) )
)
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
rankings =
RANKX(
ALLSELECTED( summary_table[od_pairs] ),
CALCULATE( SUM( [total_teus] ) )
)
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
@jeanL , Try TOPN like
CALCULATE([total_teus], TOPN(10,ALLSELECTED(summary_table[od_pairs]),[total_teus],dense), ALLSELECTED(summary_table[od_pairs]))
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
88 | |
82 | |
65 | |
64 | |
58 |
User | Count |
---|---|
171 | |
112 | |
110 | |
72 | |
72 |