March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi all,
I have forecast and actual data in diffenet format and want to combine in report format.
I can not change forecast from monthly basis to daily basis. Could you please help me to set up relationship?
All the best,
LoveParis
Solved! Go to Solution.
Hi Zoe,
Thank you for sending me the demo file.
1) Is there any reason actual is under calender?
2) I use slicer to select by country or city.
3) However.. I set up relationships (same as yours) but it seems not working. I got total value (sum of paris, london, tokyo) for each day. Is there any possible reason causing this problem?
All the best,
LoveParis
Hi paris,
You need three tables, Actual, Foreaast and calendar, then you could create a column in actual table like below
Column = SWITCH(Actual[city],"Tokyo","Japan", "Japan","Japan", "London","UK", "Paris", "France")
create the relationship like below
Then create measures like below
actual = CALCULATE ( SUM ( Actual[productions] ), FILTER ( ALL ( Actual ), Actual[date] = MIN ( 'calendar'[Date] ) ) )
forcast = CALCULATE ( SUM ( Forcast[production] ), FILTER ( ALLEXCEPT ( Forcast, Forcast[Country] ), MONTH ( Forcast[date] ) = MONTH ( MIN ( 'calendar'[Date] ) ) ) )
Then you could create table like below
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Zoe,
Thank you very much for your reply!
1) I do not need to build relationship between calender and forecast/actual?
2) People keep adding new cities. Instead of using switch function, can I creat a new table country/city and build relationship with forecast/actual?
All the best,
LoveParis
Hi paris,
Yes, you don't need to create relationship between calendar and actual,. And if you want to use another country table, you could create relationship like below
You could refer to my pbix file for more details.
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Zoe,
Thank you for sending me the demo file.
1) Is there any reason actual is under calender?
2) I use slicer to select by country or city.
3) However.. I set up relationships (same as yours) but it seems not working. I got total value (sum of paris, london, tokyo) for each day. Is there any possible reason causing this problem?
All the best,
LoveParis
Zoe,
Thank you very much for your help. I was able to solve my problem (it was caused because I did not set up many to many relation ship for both fact tables)
Thank you again!
All the best
LoveParis
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
123 | |
82 | |
69 | |
53 | |
44 |
User | Count |
---|---|
202 | |
106 | |
100 | |
64 | |
56 |