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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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