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! Learn more

Reply
Anonymous
Not applicable

Finding row wise variances from columns from two separate tables

Apologies about the weird question. I just didn't know how to word it properly. 

 

I have two tables one for older products and one for future products. I would like to create a variance table that shows the difference in Cost and Selling Price when we make the change from our Old Product to New Product with all possible permuation (A to X, A to Y, A to Z; B to X, B to Y, B to Z) etc. as the row fields.

 

 

Old Product table

ProductCost per tonneSelling Price 
A151000
B252000
C301000

New Product Table

ProductCost per TonneSelling Price
X22900
Y271500
Z332000

 

Variance Table

Old ProductNew ProductDiff in Cost per TonneDifference in Selling Price
AX7-100
BY2-500
CZ31000
AY-12-500
AZ-80
BX31100
BZ-80
1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,


According to the data you provide, you first need to use the CROSSJOIN function to create a new table, and then create two measures to calculate the difference between old_Selling Price and new_Selling Price, old_Cost per tonne and new_Cost per Tonne. You can refer to the screenshot below:

 

v-henryk-mstf_0-1610673961489.jpeg

v-henryk-mstf_1-1610673968036.png

v-henryk-mstf_2-1610673978409.png

v-henryk-mstf_3-1610673984685.png

 

Here is the sample pbix file.


If the problem is still not resolved, please provide detailed error information and let me know immediately, looking forward to your reply.


Best Regards,

Henry


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,


According to the data you provide, you first need to use the CROSSJOIN function to create a new table, and then create two measures to calculate the difference between old_Selling Price and new_Selling Price, old_Cost per tonne and new_Cost per Tonne. You can refer to the screenshot below:

 

v-henryk-mstf_0-1610673961489.jpeg

v-henryk-mstf_1-1610673968036.png

v-henryk-mstf_2-1610673978409.png

v-henryk-mstf_3-1610673984685.png

 

Here is the sample pbix file.


If the problem is still not resolved, please provide detailed error information and let me know immediately, looking forward to your reply.


Best Regards,

Henry


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , You can create a new Table like

addcolumns(crossjoin(selectcolumns('Old Product', "Old Product",[Product] "Old Cost per" [Cost per tonne],"Old Selling Price" [Selling Price]), 'New Product')
,"Price Diff" , [Cost per Tonne] - [Old Cost per] )

 

Add more columns as per need

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

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

Top Solution Authors