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

Row percent based on row total in a matrix

Hello,


I have been trying to do a seemingly easy calculation, but with no success...

 

Below is the output of a matrix that I get in Desktop. What I want to do is to get a matrix that contains % values based on the totals of each row (so, 3/19, 14/19, 2/19  .... 11/55, 21/55, and so on).

 

The values inside my matrix are frequencies, i.e. the number of cases where Rows=X and Columns=Y.

 

I attempted using SumX with AllExcept, etc but no luck. I cannot get my formula to keep the Totals (19, 55, 18) as constants so that my division can work.

 

Any help much appreciated!

 

George

 

 

 Tab.png 

1 ACCEPTED SOLUTION
Sean
Community Champion
Community Champion

It seems you want the % of each Total Row

 

Measure = 
DIVIDE (
    SUM ( Table1[Value] ),
    CALCULATE ( SUM ( Table1[Value] ), ALLSELECTED ( Table1[Column Field] ) ),
    0
)

% of Row Total.png

View solution in original post

4 REPLIES 4
Sean
Community Champion
Community Champion

It seems you want the % of each Total Row

 

Measure = 
DIVIDE (
    SUM ( Table1[Value] ),
    CALCULATE ( SUM ( Table1[Value] ), ALLSELECTED ( Table1[Column Field] ) ),
    0
)

% of Row Total.png

Anonymous
Not applicable

Thanks a million!! It was AllSelected that I needed, not AllExcept!

 

Greg_Deckler
Super User
Super User

I believe that you want to use ALL or ALLEXCEPT like:

 

SUM([Column])/CALCULATE(SUM([Column]),ALL('Table'))

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

The expected output is like this.outtput.PNG

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

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.