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 percent of row in a table

Hello,

 

I have a large matrix set up and would like to set up a measure that calculates the total row percentage. ie:

 

Item   Qtr1   Qtr2   Qtr3   Qtr4   Total

A        100    300     200    400     1000

 

The measure would calculate as 

 

Item   Qtr1   Qtr2   Qtr3   Qtr4   Total

A        10%    30%   20%   40%    100%

 

I also have a handful of page level filters that I have to account for. I tried 

%ofTotal = DIVIDE(SUM(Table[Sales]),CALCULATE(SUM(Table[Sales]), ALLEXCEPT(Table,Table[Sales]

This returns a percentage of total sales for the entire table. Please help.

1 ACCEPTED SOLUTION
Vvelarde
Community Champion
Community Champion

hi @Sean and @Anonymous

 

To calculate the % for each item this is the dax sentence:

 

% of Total Measure =
DIVIDE (
    CALCULATE ( SUM ( Table1[Sales] ) ),
    CALCULATE (
        SUM ( Table1[Sales] ),
        ALL ( Table1[Quarter], Table1[Item Description] )
    ),
    0
)

img1.png

 

And if you want 100% for each Item Description.

 

% of Total Measure =
DIVIDE (
    CALCULATE ( SUM ( Table1[Sales] ) ),
    CALCULATE ( SUM ( Table1[Sales] ), ALL ( Table1[Quarter] ) ),
    0
)

img2.png




Lima - Peru

View solution in original post

16 REPLIES 16

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.