Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Show top 3 with real total

Hi 

 

I have a table of 5 values with percent values like

20%

20%

20%

20%

20%

 

When I filter with top 3 the percent values are recalculated as a total of top 3 and not as a real total. So i have

Value 1 33.33%

Value 2 33.33%

Value 3 33.33%

 

Instead of 

Value 1 20%

Value 2 20%

Value 3 20%

 

How can I do to get top 3 and keep my real percent?

 

Many thx 

 

Best regards

2 REPLIES 2
Anonymous
Not applicable

Hi, 

 

Thanks for your help. 

What is the [percent] measure you indicate in the dax code ? 

 

I have this table 

 

TotalRisk         Risk

2               |     Electricity

4               |     Fire

8               |     Water

9               |     Gaz

3               |     Acid

 

I need to transform totalRisk in percent to each row like 

 

TotalRisk   PercentRisk        Risk

2              |      5%                      |     Electricity

4              |      10%                    |     Fire

8              |      20%                    |     Water

9              |      25%                    |     Gaz

3              |      8%                      |     Acid

 

 

And then, i need to get top 3 rank without Grand total like 

TotalRisk   PercentRisk        Risk

4              |      10%                    |     Fire

8              |      20%                    |     Water

9              |      25%                    |     Gaz

 

How can i do this ? 

 

Many thx

amitchandak
Super User
Super User

@Anonymous , Try like

 

Top 3 Rank = CALCULATE([percent],TOPN(3,all(Table[Value]),[percent],DESC),VALUES(Table[Value]))

 

If there two many same ranks try this combination

 

Rank = Ranks(all(Table[Value]),[percent]) + Rand()/100
Top 3 Rank = CALCULATE([percent],TOPN(3,all(Table[Value]),[rank],DESC),VALUES(Table[Value]))

 

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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.