This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hi Power BI community. I am relatively new to Power BI so bear with me.
I have a table of data where each row represents a production run on a specific by a specific team on a specific model etc. There are many different defects that can occur and they are each respresented with a column in the table. For example, a production run on 9/9/19 could have a value of 200 in the 'Input' column, a value of 2 in the 'Defect 1' column, and a value of 10 in the 'Defect 7' column. The rest of the Defect columns in that row would have a value of zero in them.
I have a visual that shows the frequency that each specific defect occurs according to a date hierarchy. Say there are 10 defects. I would like to be able to make the visual only show the top three defects for a specific date range determined by a slicer.
I have looked into this and could only find information relating to the RANKX function which ranks values in a column. Since I need to rank actual columns by their sum this was not helpful to me.
Solved! Go to Solution.
Hello @Anonymous
The only way I know of to do what you are looking for is to unpivot the defects informatoin so you end up with 2 columns, defect type and value. Then you can do the ranking on the value column.
Top 3 defects =
VAR RankingContext = VALUES ( Defects[Defect] )
RETURN
CALCULATE(
[Defect Amount],
TOPN ( 3, ALL ( Defects[Defect] ), [Defect Amount] ),
RankingContext
)
I have attached my sample file for you to look at.
Hello @Anonymous
The only way I know of to do what you are looking for is to unpivot the defects informatoin so you end up with 2 columns, defect type and value. Then you can do the ranking on the value column.
Top 3 defects =
VAR RankingContext = VALUES ( Defects[Defect] )
RETURN
CALCULATE(
[Defect Amount],
TOPN ( 3, ALL ( Defects[Defect] ), [Defect Amount] ),
RankingContext
)
I have attached my sample file for you to look at.
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 31 | |
| 26 | |
| 23 | |
| 22 | |
| 13 |
| User | Count |
|---|---|
| 61 | |
| 47 | |
| 27 | |
| 23 | |
| 18 |