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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
GabiDN
Frequent Visitor

Calculate difference between two tables same data, different week of forecast

Hi,

 

I am trying to calculate the difference between 2 tables that have the same data, one is filtered to show the current week and the other the previous week. I want to have another table that shows the difference between the 2.

Also I want the data from table 3 to change everytime I change the filer for week of forecast. 

 

image.png

 

Please could you reccommend how to approch this?

 

Thank you,

Gabi

7 REPLIES 7
Anonymous
Not applicable

Hi @GabiDN ,

Could you please share some sample data in these three tables(exclude sensitive data) and your expected result with calculation logic and special examples in order to provide you a suitable solution? Also, please provide your visual settings. It is better if you can provide your sample pbix file. Did these data in the matrix come from different tables? Thank you.

In addition, please review the content in the following links. Hope they can help you.

Calculating the total sum of the difference between current and previous weeks?

Calculate difference in values from the current week

Best Regards

Hi @Anonymous ,

 

Thanks for the suggestion. 

I try to attache the pbix file here, but the file type is not supported.
The original data comes from the same table, then I creted 2 different tables to show the current week and previous week results. Then I want a 3rd table that shows the difference between them (value, or %).

 

 

Anonymous
Not applicable

Hi @GabiDN ,

You can refer the method in the following thread to upload the file. Besides that, you can share some sample data with Text format and paste it in your post directly. Also please share your visual settings, the formula of measures involved in visuals and expected result with backend logic and special examples. Thank you.

How to upload PBI in Community

Best Regards

Hi @Anonymous ,

 

I attached the file on the link bellow. There are some data in .txt format and the pbix I was working on.

Power BI 

I was trying to create new tables and connect them with the main one using the start schema.

Still not getting the right results. I am trying to play with the filters on the measure now and see where it gets me. 

Do you have any other suggestions?

GabiDN_0-1629360639681.png

GabiDN_1-1629360659243.png

 

Thank you!

Anonymous
Not applicable

Hi @GabiDN ,

I tried to download your pbix file, but it failed due to I have Google account. Could you please share the file with me via Private Message? Please exclude sensitive information before share it. Thank you.

yingyinr_0-1629422631796.png

By the way, the data in Table 1 is for current week and the data in Table 2 is for previous week? Whether the matrix with difference info also need to include the months?

Best Regards

amitchandak
Super User
Super User

@GabiDN , Join them with common dimensions like geography, date etc and then take diff of measure

 

Means create star schema and use measure from both tables against common dimension

https://www.sqlbi.com/articles/the-importance-of-star-schemas-in-power-bi/

 

Bridge Table: https://www.youtube.com/watch?v=Bkf35Roman8&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=19

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak , Thank you for the fast reply. I will try this and see how it goes.
I will come back with an update.

 

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.