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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
justivan
Helper II
Helper II

Show percentage of parent total - Matrix Visual

Hello,

To be honest, I'm not really sure if what I'm trying to do is possible at all. What I'm trying to do is show the percentage based on the parent total but I want the parent total to display the actual value. Say for example, Address Beach have a total of 500 room night produced in which client2 contributed 96.6% on that 500 room nights. I'm not really sure how to approach this in power BI I just generated this in excel pivout's table and showed the value as % of Parent Total. Is this doable in matrix visual?

justivan_0-1625386244852.png

Thank you in advance!

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@justivan 

You can do it this way but using the FORMAT function. I sed a sample data set in Power BI, you can replicate the same for your data.

% of Total = 
IF(
    ISINSCOPE(financials[Segment]),
        
    DIVIDE(
        [Total Sales],
        CALCULATE(
            [Total Sales],
            ALLSELECTED( financials[Segment] )
        )
    ),
    FORMAT( [Total Sales], "#,#0" )
)

Fowmy_0-1625390559681.png

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

3 REPLIES 3
Fowmy
Super User
Super User

@justivan 

You can do it this way but using the FORMAT function. I sed a sample data set in Power BI, you can replicate the same for your data.

% of Total = 
IF(
    ISINSCOPE(financials[Segment]),
        
    DIVIDE(
        [Total Sales],
        CALCULATE(
            [Total Sales],
            ALLSELECTED( financials[Segment] )
        )
    ),
    FORMAT( [Total Sales], "#,#0" )
)

Fowmy_0-1625390559681.png

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Hi @Fowmy ,
This is it! I tried using IF and ISFILTERED to identity the hierarchy then do the calculations according to the result but have given up because of the formats. Parent is number so the child are showing decimals. I didn't know you can do it that way. I'll certainly look into that ISINSCOPE function but if you could tell me, is ISFILTERED  a valid approach too? Thank you so much for this!

@justivan 
You can use ISFILTERED but if you insert a slicer with Segment, the measure would not give you the expected results. ISINSCOPE check if the column is grouped within the query.

Find more details here: https://dax.guide/isinscope/




Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.