cancel
Showing results for 
Search instead for 
Did you mean: 
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 IV
Super User IV

@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 IV
Super User IV

@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

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
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

Top Solution Authors