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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Jasorami
New Member

Help Subtotal ISINSCOPE

Hello, I am creating a Price volume Mix analysis in PowerBI , with the correct subtotal values at each level using ISINSCOPE, but I have some error 😞

 

Thanks in advance for your help 🙂

 

Scenario: Actual vs Budget

 

Formulas

Price:

= IF(SUM('DB'[2022 Bud USD])=0,0,
IF(SUM('DB'[2022 Act USD])=0,0,
([Avg Price Act]-[Avg Price Bud])*SUM('DB'[2022 Act Qty])))
Mix:
=IF(SUM('DB'[2022 Bud USD])=0,0,
IF(SUM('DB'[2022 Act USD])=0,0,
[2022 Tot Inv]*([Act % Qty]-[Bdg % Qty])*([Avg Price Bud]-[2022 Tot Avg Prc Bdg])))

Vol:

=IF(SUM('DB'[2022 Bud USD])=0,[Bdg Change],
IF(SUM('DB'[2022 Act USD])=0,[Bdg Change],
(sum('DB'[2022 Act Qty])-sum('DB'[2022 Bud Qty]))*[Avg Price Bud])-[Mix])
 
The results of the previous formulas are ok, for each sku.
But when I am traying to subtotalize in a hierarchy level using ISINSCOPE with an additional meassure, the subtotal value for price is ok,, but for Mix and Vol the subtotals are incorrect:
 
What I have wrong in the Mix and Vol formulas?? 😞
 
Jasorami_0-1646244930410.png
Jasorami_2-1646245569971.png

 

Price:

Pric2 Bdg =
SWITCH(
TRUE(),
ISINSCOPE('DB'[Material (BE #)]),[PVM Pric Bdg],
ISINSCOPE('DB'[Product hierarchy level 4])||ISINSCOPE('DB'[Product hierarchy level 3])||
ISINSCOPE('DB'[Product hierarchy level 2])||ISINSCOPE('DB'[Product hierarchy level 1])||
ISINSCOPE('DB'[Application Field])||ISINSCOPE('DB'[Market Field])||
ISINSCOPE('DB'[Company Name]),
SUMX(VALUES('DB'[Material (BE #)]),[PVM Pric Bdg]))

 

Mix:

Mix2 Bdg =
SWITCH(
TRUE(),
ISINSCOPE('DB'[Material (BE #)]),[PVM Mix Bdg],
ISINSCOPE('DB'[Product hierarchy level 4])||ISINSCOPE('DB'[Product hierarchy level 3])||
ISINSCOPE('DB'[Product hierarchy level 2])||ISINSCOPE('DB'[Product hierarchy level 1])||
ISINSCOPE('DB'[Application Field])||ISINSCOPE('DB'[Market Field])||
ISINSCOPE('DB'[Company Name]),
SUMX(VALUES('DB'[Material (BE #)]),[PVM Mix Bdg]))

 

Vol:

Vol2 Bdg =
SWITCH(
TRUE(),
ISINSCOPE('DB'[Material (BE #)]),[PVM Vol Bdg],
ISINSCOPE('DB'[Product hierarchy level 4])||ISINSCOPE('DB'[Product hierarchy level 3])||
ISINSCOPE('DB'[Product hierarchy level 2])||ISINSCOPE('DB'[Product hierarchy level 1])||
ISINSCOPE('DB'[Application Field])||ISINSCOPE('DB'[Market Field])||
ISINSCOPE('DB'[Company Name]),
SUMX(VALUES('DB'[Material (BE #)]),[PVM Vol Bdg]))
2 REPLIES 2
v-cazheng-msft
Community Support
Community Support

Hi @Jasorami ,

 

May I know whether your issue has been resolved? If you still have problems on it, could you please provide some sample data from your tables and let us know the relationships among them so we can try to find a solution for you? Thanks in advance!

 

Best Regards,

Community Support Team _ Caiyun

littlemojopuppy
Community Champion
Community Champion

Hi @Jasorami can you share some data?

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.