Forum Discussion
Displaying top 10 variable cost
Hi, I am trying to display a table that shows the top 10 variable cost.
The data source that i have is in this format:
Date | Employee | Basic | Allowance | Commission | Total Employment Cost |
| 1/1/2020 | A | xxx | xxx | xx | xxx |
| 1/1/2020 | A | xxx | xxx | xx | xxx |
| 1/2/2020 | B | xxx | xxx | xx | xxx |
| 1/2/2020 | B | xxx | xxx | xx | xxx |
The visual display that i want would be like this:
| 2020 | Rank | |
| Basic | xxxxx | 1 |
| Commission | xxxxx | 2 |
I tried using table or matrix but i could not get what i want, perhaps is the format of my data source, is there another way to work around it without changing the format of the data source?
Anonymous , first you need to unpivot the table
https://radacad.com/pivot-and-unpivot-with-power-bi
https://youtu.be/2HjkBtxSM0gThen You need to create Rank or TOP 10
For Rank Refer these links
https://databear.com/power-bi-dax-topn-function/
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
1 Reply
- amitchandak
Super User
Anonymous , first you need to unpivot the table
https://radacad.com/pivot-and-unpivot-with-power-bi
https://youtu.be/2HjkBtxSM0gThen You need to create Rank or TOP 10
For Rank Refer these links
https://databear.com/power-bi-dax-topn-function/
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