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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Calculate Top 3 percentage on grand total

I created a Top 3 matrix visual for the following data, I would like to know how to calculate the top 3 percentage on the grand total for each year as shown below marked in red.

 

pbi_1.JPG

 

Thanks a lot.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , You can get top3 % like

divide(CALCULATE([Amount],TOPN(3,all(Table[item]),[Amount],DESC),VALUES(Table[item] )) ,CALCULATE([Amount], allselected))

 

But I doubt you can add that a new row. You can replace grand total using isinscope and hasonevalue

https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/

https://powerpivotpro.com/2013/03/hasonevalue-vs-isfiltered-vs-hasonefilter/

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @Anonymous,

If you are work with the matrix visual with default aggregate functions, you can right-click on the value fields to choose 'show value as' -> 'percent of grand total'. Then it will show the grand total percent of total value instead of the default summary values.

18.png
Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
amitchandak
Super User
Super User

@Anonymous , You can get top3 % like

divide(CALCULATE([Amount],TOPN(3,all(Table[item]),[Amount],DESC),VALUES(Table[item] )) ,CALCULATE([Amount], allselected))

 

But I doubt you can add that a new row. You can replace grand total using isinscope and hasonevalue

https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/

https://powerpivotpro.com/2013/03/hasonevalue-vs-isfiltered-vs-hasonefilter/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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