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
udian
Helper III
Helper III

DAX Calculate Percentage from Column Total

I am trying to build a tabular cube measure that will always calculate the percentage from the column total even when using a matrix.

Percentage from total.JPG

 

In the example attached i would like to get X % of Total and Y % of Toal columns.
The measure should be dynamic and work with regardless of the dimension the user will place in the columns so the option of using Calculate(SUM(Salse_Quantity),ALL(Products[Product Name])) or                    Calculate(SUM(Salse_Quantity),ALLSELECTED(Products)) is not good enough.

 

Is there any way to achieve this?

 

Thanks!

1 REPLY 1
LaurentCouartou
Solution Supplier
Solution Supplier

You cannot detect what is on rows or what is on columns in DAX, so you cannot do a true "Column Total". However, something like this, may work for you:

 

SUM(Salse_Quantity) /

Calculate(SUM(Salse_Quantity)
      ,Product
      ,ALLSELECTED()
)

 

 

 

 

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.

Top Solution Authors