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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Calculate moving totals

I need to calculate moving total based on the selection of the drill down columns. For eg, in first step it to calculate Apparel by Total GL (values from column 1  ie 25229318/88093701 and ratio column contains the corresponding percentage)

swathi1997_0-1654698096209.png

In next step, i want to calculate Column 1 value divided by Pricing Driver 1 total , which comes after drilling down Apparel (ie. column1/total of Apparelor Pricing Driver 1, 3015266/25229318) instead of total of entire GL column

swathi1997_1-1654698444215.png

 

So, if i expand Base Pricing from pricing driver 1 column i should take that total in denominator.

That is how i need to change my total in denominator based on selection in column drill downs.

Kindly help me in finding the moving total based on selection.

 

@amitchandak  Please help me out on the same as i got correct result last time when u shared your experience.

 

 

 

 

2 ACCEPTED SOLUTIONS
MFelix
Super User
Super User

Hi @Anonymous ,

 

Try the following measure:

Ratio =
IF (
    ISINSCOPE ( 'Table'[Sub CAt] ),
    DIVIDE (
        SUM ( 'Table'[Value] ),
        CALCULATE ( SUM ( 'Table'[Value] ), ALLSELECTED ( 'Table'[Sub CAt] ) )
    ),
    DIVIDE (
        SUM ( 'Table'[Value] ),
        CALCULATE ( SUM ( 'Table'[Value] ), ALLSELECTED ( 'Table'[CAt] ) )
    )
)

 

Has you can see below the results for the Main categories re in line with the second column that is the calculation of the % of Column:

MFelix_0-1654780297409.png

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

Anonymous
Not applicable

@MFelix , Thanks for the reply, i have 3 step drill down, how do we calculate for 3rd step drill down column

 

swathi1997_0-1654782514219.png

 

View solution in original post

5 REPLIES 5
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

Whether the advice given by @MFelix  has solved your confusion, if the problem has been solved you can mark the reply for the standard answer to help the other members find it more quickly. If not, please point it out.


Looking forward to your feedback.


Best Regards,
Henry

Ashish_Mathur
Super User
Super User

Hi,

Share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

@MFelix , Thanks for the reply, i have 3 step drill down, how do we calculate for 3rd step drill down column

 

swathi1997_0-1654782514219.png

 

Try the following setup:

 

Ratio =
SWITHC(TRUE(),

    ISINSCOPE ( 'Table'[Level3] ),
    DIVIDE (
        SUM ( 'Table'[Value] ),
        CALCULATE ( SUM ( 'Table'[Value] ), ALLSELECTED ( 'Table'[Level 3] ) )
    ),

    ISINSCOPE ( 'Table'[Level2] ),
    DIVIDE (
        SUM ( 'Table'[Value] ),
        CALCULATE ( SUM ( 'Table'[Value] ), ALLSELECTED ( 'Table'[Level 2] ) )
    ),
       ISINSCOPE ( 'Table'[Level1] ),
    DIVIDE (
        SUM ( 'Table'[Value] ),
        CALCULATE ( SUM ( 'Table'[Value] ), ALLSELECTED ( 'Table'[Level 1] ) )
    )
)

 

Be very aware of the order.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



MFelix
Super User
Super User

Hi @Anonymous ,

 

Try the following measure:

Ratio =
IF (
    ISINSCOPE ( 'Table'[Sub CAt] ),
    DIVIDE (
        SUM ( 'Table'[Value] ),
        CALCULATE ( SUM ( 'Table'[Value] ), ALLSELECTED ( 'Table'[Sub CAt] ) )
    ),
    DIVIDE (
        SUM ( 'Table'[Value] ),
        CALCULATE ( SUM ( 'Table'[Value] ), ALLSELECTED ( 'Table'[CAt] ) )
    )
)

 

Has you can see below the results for the Main categories re in line with the second column that is the calculation of the % of Column:

MFelix_0-1654780297409.png

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.