Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
Check it out now!Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
Hi there
I currently have two separate tables one containing actual costs by project by month and the other containing the forecast by project by month.
Actuals
Project | Month | Cost |
A | 31/1/24 | 100 |
A | 29/2/24 | 200 |
A | 31/3/24 | 150 |
B | 31/1/24 | 100 |
B | 29/2/24 | 100 |
B | 31/3/24 | 75 |
Forecast
Project | Month | Cost |
A | 31/1/24 | 200 |
A | 29/2/24 | 200 |
A | 31/3/24 | 200 |
A | 30/4/24 | 200 |
A | 31/5/24 | 200 |
... | ... | ... |
B | 31/1/24 | 100 |
B | 29/2/24 | 100 |
B | 31/3/24 | 100 |
B | 30/4/24 | 100 |
B | 31/5/24 | 100 |
... | ... | ... |
I am looking to create a table as below which uses actuals for previous months and forecast for current and future months. Currently the tables are not linked, assume I will need some sort of date table to link these and then a dax measure to populate the table?
Project | 31/1/24 | 29/2/24 | 31/3/24 | 30/4/24 | 31/5/24 | ... |
A | 100 | 200 | 150 | 200 | 200 | ... |
B | 100 | 100 | 75 | 100 | 100 | ... |
Any help on this would be very much appreciated!!
Solved! Go to Solution.
@metcala what is your backend source? If it is some SQL server, you can view it with the unique value, if not then you can easily do it in PQ, assuming the forecast table has all the projects.
- right click on the forecast table and click reference, it will duplicate the forecast table
- select project column, right-click, remove other columns
- select the project column, and right-click, select remove duplicates.
rename this table as you see fit and here you have a table with unique values of all the projects.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@metcala what is your backend source? If it is some SQL server, you can view it with the unique value, if not then you can easily do it in PQ, assuming the forecast table has all the projects.
- right click on the forecast table and click reference, it will duplicate the forecast table
- select project column, right-click, remove other columns
- select the project column, and right-click, select remove duplicates.
rename this table as you see fit and here you have a table with unique values of all the projects.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@parry2k Thanks so much for the quick reply that's really helpful.
What would be the best way to create the project dimension table? Every project will have a forecast so is there an easy way to just create a table using unique values from the forecast table project column?
@metcala you need two dimension tables, one date dimension, and the other project dimension. Project table will have unique project ids. Set the relationship of these new tables with the actual and forecast table on the respective column.
On matrix visual, use date from the date dimension, project from the project dimension, and add the following measure to use on the value. Tweak this measure as you see fit but this will get you started.
Measure =
VAR __Actual = SUM ( ActualTable[Actual Column] )
VAR __Forecast = SUM ( ForecastTable[Forecast Column] )
VAR __Display = IF ( MAX ( 'Date Table'[Date] ) <= TODAY (), __Actual, __Forecast )
RETURN
__Display
As a best practice, add a date dimension in your model and use it for time intelligence calculations. Once the date dimension is added, mark it as a date table on table tools. Check the related videos on my YT channel
Add Date Dimension
Importance of Date Dimension
Mark date dimension as a date table - why and how?
Time Intelligence Playlist
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.