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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Need help for MAT calculation in Power BI

Hi Everyone,

 

I got stuck to calculate MAT (Moving Annual Total) Sales in my report, please help me on the same

 

Data Scenario: Have Fact table (has only Quarterly aggregated sales values) and Aggregation table, either I need to acheive Solution 1 or Solution 2 which is given below

 

I have created a bridge table with distinct Year Quarter (which is the only join column between fact and Aggregator table)

 

Data Example:

 

Fact Table
Year Quarter Product Code Product Name Sales
20191 ABC ABC Parcel 500
20192 ABC ABC Parcel 750
20193 ABC ABC Parcel 250
20194 ABC ABC Parcel 2000
20194 XYZ XYZ Company 350
20201 XYZ XYZ Company 450
20202 XYZ XYZ Company 1250
20203 XYZ XYZ Company 250

 

Aggregator Table
Year Quarter Quarter Aggregator Aggregation Type
20194 20191 MAT
20194 20192 MAT
20194 20193 MAT
20194 20194 MAT
20194 20194 QTD
20203 20194 MAT
20203 20201 MAT
20203 20202 MAT
20203 20203 MAT
20203 20203 QTD

 

Expected Solution 1: 

Year Quarter Product Code Product Name Aggregation Type Sales
20194 ABC ABC Parcel QTD 2000
20194 ABC ABC Parcel MAT 3500
20203 XYZ XYZ Company QTD 250
20203 XYZ XYZ Company MAT 2300

 

Expected Solution 2:

Year Quarter Product Code Product Name Aggregation Type QTD Sales MAT Sales
20194 ABC ABC Parcel QTD 2000 3500
20203 XYZ XYZ Company QTD 250 2300

 

 

 

 

1 REPLY 1
v-stephen-msft
Community Support
Community Support

Hi @Anonymous ,

 

What is the relationship between these two columns and why are there two columns of year and quarter?

6.png

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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