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

Percentage Matrix based on one category only

Hi Experts

 

How would i find the percentage of the total value for one category only ie. over 6 weeks total divided by the grand total
see image 
Result should be 1- (35 /583) this is a matrix table.

Checkers111_0-1657015870625.png

 

1 ACCEPTED SOLUTION

In that case, try:

 

 

Under 6 weeks / Total =
VAR _all =
    CALCULATE ( [Measure], ALL ( 'Table' ) )
RETURN
    IF (
        SELECTEDVALUE ( Table[Period] ) = "Under 6 weeks",
        IF (
            ISINSCOPE ( Table[BookedUnbooked] ),
            BLANK (),
            1 - DIVIDE ( [Measure], _all )
        )
    )

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

3 REPLIES 3
PaulDBrown
Community Champion
Community Champion

It depends on the structureo the model/tables and the fields used in the matrix ( you need to adapt the code to include the actual Tables/columns and measure) Something along the lines of:

 

Over 6 weeks / Total =
VAR _all =
    CALCULATE ( [Measure], ALL ( 'Table' ) )
RETURN
    IF (
        SELECTEDVALUE ( Table[Period] ) = "Over 6 weeks",
       1- DIVIDE ( [Measure], _all )
    )

 

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Anonymous
Not applicable

Hi Paul - i like the idea but it need to be the total of the under 6 weeks - not the booked and unbooked items

In that case, try:

 

 

Under 6 weeks / Total =
VAR _all =
    CALCULATE ( [Measure], ALL ( 'Table' ) )
RETURN
    IF (
        SELECTEDVALUE ( Table[Period] ) = "Under 6 weeks",
        IF (
            ISINSCOPE ( Table[BookedUnbooked] ),
            BLANK (),
            1 - DIVIDE ( [Measure], _all )
        )
    )

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






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.