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
pmxgs
New Member

Price Variance Actuals vs Budget in separate tables (calculated at Product & Customer Level)

Hello, 

 

Presently, my data is in single table, where I have the typical columns, like date, product, customer, sales, volume.

 

ScenarioCustomerProductVolumeSalesprod-cust_key
ActualAp1510Ap1
ActualAp2715Ap2
ActualBp1923Bp1
ActualBp1716Bp1
BudgetAp1510Ap1
BudgetAp2715Ap2
BudgetBp1923Bp1
BudgetBp1716Bp1

 

With this data setup, so far I've used the following approach to calculate variances between actuals and budget (at customer & product level).

Volume Act= calculate (volume,phase="Actuals ")

Volume Bud= calculate (volume,phase="Bud ")

Avg Price Act = calculate (sales,phase="Actuals ")/Volume Act

Avg Price Bud = calculate (sales,phase="Budget ")/Volume Bud

Price Variance=sumx(values(prod-cust_key),(Avg Price Act-Avg Price Bud)*Volume_Act)

 

Now I will have two separate tables, one for actuals and another one for Budget (actuals has finer granularity for product codes, etc), but I want to keep calculating price variance at the same level (main product & customer level).

 

I'm thinking of creating a single table using UNION (adjusting the budget table to have the same structure as actuals), so that I keep calculating price variances the same way.

I would like to know if there is an alternative way of reaching the same goal, without having to join both tables using UNION.

 

thanks,

pm

1 ACCEPTED SOLUTION
MasonMA
Resident Rockstar
Resident Rockstar

@pmxgs 

There are, but I would stick with the UNION approach since you’re calculating at a higher level (e.g., product & customer) and already using prod-cust_key, unless you have a business constraint that prevents merging the tables...

View solution in original post

2 REPLIES 2
MasonMA
Resident Rockstar
Resident Rockstar

@pmxgs 

There are, but I would stick with the UNION approach since you’re calculating at a higher level (e.g., product & customer) and already using prod-cust_key, unless you have a business constraint that prevents merging the tables...

bhanu_gautam
Super User
Super User

@pmxgs 

Create relationships between Actuals and ProductCustomer, and Budget and ProductCustomer on Customer and Product.

 

Define measures to calculate the actual and budget volumes and sales.

Volume_Act = CALCULATE(SUM(Actuals[Volume]))
Sales_Act = CALCULATE(SUM(Actuals[Sales]))
Volume_Bud = CALCULATE(SUM(Budget[Volume]))
Sales_Bud = CALCULATE(SUM(Budget[Sales]))

 

Define measures to calculate the average prices for actuals and budget.


Avg_Price_Act = DIVIDE([Sales_Act], [Volume_Act])
Avg_Price_Bud = DIVIDE([Sales_Bud], [Volume_Bud])

 

Finally, define a measure to calculate the price variance.

Price_Variance = SUMX(
VALUES(ProductCustomer[prod-cust_key]),
([Avg_Price_Act] - [Avg_Price_Bud]) * [Volume_Act]
)




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

Proud to be a Super User!




LinkedIn






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!

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.