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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
newgirl
Post Patron
Post Patron

Percentage of a Parent Row Total

Hello!

 

I havea  simple raw data of volume with business unit, brand, and date. I want to show a matrix showing the percentage of parent grand total. I read some articles and I started out with a small dataset in which I was able to create the matrix I want:

subtotal3.JPG

 

using this formula:

ParentVolume = 
var _Parent = IF(
    ISFILTERED('Table'[Brand]),
    CALCULATE(
        SUM('Table'[Volume]),
        ALL('Table'[Brand])),
        CALCULATE(
            SUM('Table'[Volume]),
            ALL('Table'[Business Unit])))
RETURN SUM('Table'[Volume])/_Parent

 

However, when I tried to apply it in my official report, it's only showing the percentage breakdown per brand but not the percentage breakdown per Business Unit

 

When viewing the per Business Unit level (it's showing 100% for every Business Unit)

subtotal.JPG

 

When viewing the per Business Unit > per Brand level:

subtotal2.JPG

 

And here's my measure:

 

Volume_all_perBU % = 
VAR _parent =
IF(
    ISFILTERED('CR tbl_phrawsales'[Brand]),
    CALCULATE(
        SUM('CR tbl_phrawsales'[Actually billed amount]),
        ALL('CR tbl_phrawsales'[Brand])),
        CALCULATE(
            SUM('CR tbl_phrawsales'[Actually billed amount]),
            ALL('CR tbl_phrawsales'[Business Unit])))
RETURN divide(sum('CR tbl_phrawsales'[Actually billed amount]),_parent,0)

 

I already checked the row fields in the matrix, they are correct. These are the columns from CR tbl_phrawsales.

Can somebody help me figure out why it's not working on the per Business Unit level?

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @newgirl ,

I created some data:

vyangliumsft_0-1666330071718.png

Are you referring to calculating different levels in the matrix?

Here are the steps you can follow:

1. Create measure.

Measure =
IF(  
    ISINSCOPE('Table'[Group3]),4,
    IF(
ISINSCOPE('Table'[Group2])&&NOT(ISINSCOPE('Table'[Group3])),3,
IF(
    ISINSCOPE('Table'[Group1]),2,0)
))

2. Result:

vyangliumsft_1-1666330071721.png

If you need pbix, please click here.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

2 REPLIES 2
v-yangliu-msft
Community Support
Community Support

Hi  @newgirl ,

I created some data:

vyangliumsft_0-1666330071718.png

Are you referring to calculating different levels in the matrix?

Here are the steps you can follow:

1. Create measure.

Measure =
IF(  
    ISINSCOPE('Table'[Group3]),4,
    IF(
ISINSCOPE('Table'[Group2])&&NOT(ISINSCOPE('Table'[Group3])),3,
IF(
    ISINSCOPE('Table'[Group1]),2,0)
))

2. Result:

vyangliumsft_1-1666330071721.png

If you need pbix, please click here.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

@newgirl I want to achieve the same thing as posted by you in the very first img.
I have 3 dimension tables connected to one fact table... and I am using the rows from all 3 dim tables in a matrix in rows....I want to calculate percentage of parent row total just like you....please help.

Abhis321_0-1726840794632.png


Example here is ...5264 is 42% of total.....now I want that at Below(-)500 ..it will give me 3/5264...and similar for every row...for total of 100% ....
Further I have one more row .....which will follow the same thing as opened
@v-yangliu-msft ...please help

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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