Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hello
I am trying to find the top 3 values per row for a series of columns and bind it to the bar chart
Example:
ID | Column2 | Column3 | Column4 | Column5 | Column6 | Column7 | Column8 | Column9 | Column10 | Column11 | Column12 | Column13 |
1 | 5 | 1 | 1 | 0 | 2 | 5 | 8 | 2 | 0 | 1 | 12 | 100 |
2 | 0 | 0 | 22 | 0 | 0 | 0 | 0 | 0 | 10 | 0 | 1 | 200 |
Result:
ID | Column13 | Column12 | Column8 | Column4 | Column10 |
1 | 100 | 12 | 8 | ||
2 | 200 | 22 | 10 |
I need a way to determine the value of 13 columns
Thanks in advance
Solved! Go to Solution.
@Anonymous,
Unpivot Columns in Query Editor, then use Matrix visual and drag measure below to Values.
Measure = IF ( RANKX ( ALLSELECTED ( Table1[Attribute] ), CALCULATE ( SUM ( Table1[Value] ) ) ) <= 3, SUM ( Table1[Value] ) )
can you unpivot the data so the columns would be in rows? you could still present it in the way the 2nd table is formatted but the code get's much more simple
Thanks for your reply.
I unpivotted table and managed to put top 3 filter in "Visual filter", but the column names are not changing based on ID. It's same for all ID.
@Anonymous,
Unpivot Columns in Query Editor, then use Matrix visual and drag measure below to Values.
Measure = IF ( RANKX ( ALLSELECTED ( Table1[Attribute] ), CALCULATE ( SUM ( Table1[Value] ) ) ) <= 3, SUM ( Table1[Value] ) )
I have 3 areas calculated as Area1, Area2 and Area3 in different columns. I'd like to get the 2nd highest area among the 3.
How do I do this in the dax level instead of using a matrix visual and a measure?
Your solution would be of great help.
Thanks in advance.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.