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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

MAT Calculation from 2 Datasets

Hello everyone

 

I'm new into PowerBi and i love this place because i have been able to get some ideas.

But now im trying to do something that i have on my Excel spreadsheet but i want to do it in Power BI.

I'm building a MAT(Moving Annual Total).

In my Excel Spreadsheet i have the months with the years on top, but i want to add the my forecast into the months. My dataset is in 2 different Tabs one for the actuals and one for the forecasts and i want to have this in a single Matrix and then do a Line graph with this information to see the total amount per year.

 

What i'm trying to do is a formula in the Transform Data module, but i don't have the knowledge to do it.. on how to get the Forecast information into the actuals into a column , as i tried the sum , but it only give me full total...

any help is valuable! thx!

 

Example

2022                     2022                 2022               2022  

March(Actual)  April(Actual)     May (FCST)      Jun(FCST)

2 REPLIES 2
v-kkf-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please create the following inter-table relationships and measure.

 

vkkfmsft_0-1653380206003.png

Measure = 
IF (
    MAX ( 'Calendar'[Date] ) >= TODAY (),
    SUM ( ForecastTable[Sales] ),
    SUM ( FactTable[Sales] )
)

vkkfmsft_1-1653380268251.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

NickolajJessen
Solution Sage
Solution Sage

The example you provided is an example of your desired outcome, right?

How is your data structured on the two tabs?
You might me searching for the transpose button, but it's hard to tell with no examples or pbix



Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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