Forum Discussion
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.
Please could you reccommend how to approch this?
Thank you,
Gabi
7 Replies
- amitchandak
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
- GabiDNFrequent Visitor
amitchandak , Thank you for the fast reply. I will try this and see how it goes.
I will come back with an update.
- AnonymousNot 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
- GabiDNFrequent Visitor
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 %).- AnonymousNot 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