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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
pmxgs
New Member

Price variance Actuals vs Budget in two separate tables

Hello, 

 

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

With this data setup, so far I've used the following approach to calculate variances between actuals and budget.

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(product),(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 level).

 

I'm thinking of creating a single table using UNION (adjusting a bit the budget table so that I 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
FBergamaschi
Solution Sage
Solution Sage

I would keep the two tables separated

 

Connect the product table to both actuals and budget tables, create a volume measure and average measure on each (without calculate calls in them) and then the DAX code stays

 

sumx(values(product),(Avg Price Act-Avg Price Bud)*Volume_Act)

 

If this helped please give kudos and or marke it as a solution

 

Thanks

 

Best

FB

View solution in original post

6 REPLIES 6
pmxgs
New Member

Thanks for the solution provided.

I tested and it worked.


FBergamaschi
Solution Sage
Solution Sage

I would keep the two tables separated

 

Connect the product table to both actuals and budget tables, create a volume measure and average measure on each (without calculate calls in them) and then the DAX code stays

 

sumx(values(product),(Avg Price Act-Avg Price Bud)*Volume_Act)

 

If this helped please give kudos and or marke it as a solution

 

Thanks

 

Best

FB

If I want to calculate price variance at customer and product level, would you recomend the same approach ?(both customer and product columns are present in actuals and budget tables) 

In this case I probably need to create an additional table with unique values of Product&Customer key?

 

thanks

Hello, yes that's correct

Please mark a solution if this is now complete

Thanks

Best regards

Sorry I just saw you already marked as solution

 

Thanks!

Yes, the solution for the first question is ok.

If I need to do rhe same calculation at product & customer level , do I need to have a related table with all the unique product&customer keys?

presently, sine I have everything in the same table, I have a calculated column  for the prod&cust key and use this in the values function. 
Since product and customer are different tables, what would be the best approach?

thanks

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.