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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
kukszi
Helper I
Helper I

How to organize calculated measures into hierarchies

Hi there,

 

Recently I had a question about how can I extrapolate the national sales if I have partial information only. 

 

Now I need to bring this model to the next level, where the extrapolated values are displayed in a matrix visual, and the products are combined into product hierarchies. E.g Prod 1 and Prod 3 belong to ProdHier1, and Prod 2 and Prod 4 belong to ProdHier2, and also ProdHier1 and ProdHier2 belong to ParentHier1.

 

My problem is when I'm displaying the values in a matrix visual, the subtotals of the extrapolated provinces (AB and SK) are not correct, while the subtotals of the provinces with actual data (BC and ON) are correct:

pbierror.png

 

Can someone please let me know how can I fix the displayed subtotals for the extrapolated provinces?

 

Bonus question: what if I need to organize the customers to hierarchies too (e.g Cust 1 and Cust 2 are "Key Accounts", Cust 3, Cust 4 and Cust 5 are "Other customers")?

 

For reference, the pbix file is uploaded here

 

Thanks,
kukszi

 

@mahoneypat, @Anonymous 

 

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

Try this:

 

Replace the AllExcept part of your Extrapolation total measure with this

 

ALLEXCEPT ( Actuals, Actuals[Product], Actuals[ProdHier] ),
 
This makes it so it doesn't remove the filter from ProdHier.  Add ParentHier column too if you will be using that in the matrix.
 

If this works for you, please mark it as solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@kukszi , I changed it, see if works

Extrapolated Total = 
VAR __actuals =
SUM ( Actuals[Volume] )
VAR __extrapolation =
SUMX (
Extrapolate,
Extrapolate[ExtrapolationFactor]
* CALCULATE (
SUM ( Actuals[Volume] ),
ALLEXCEPT ( Actuals, Actuals[Product] ,Actuals[ProdHier]),
TREATAS ( VALUES ( Extrapolate[BaseToBeUsed] ), Actuals[Province] ),
TREATAS ( VALUES ( Extrapolate[Customer] ), Actuals[Customer] )
)
)
RETURN
__actuals + __extrapolation
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
mahoneypat
Microsoft Employee
Microsoft Employee

Try this:

 

Replace the AllExcept part of your Extrapolation total measure with this

 

ALLEXCEPT ( Actuals, Actuals[Product], Actuals[ProdHier] ),
 
This makes it so it doesn't remove the filter from ProdHier.  Add ParentHier column too if you will be using that in the matrix.
 

If this works for you, please mark it as solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors