cancel
Showing results for
Did you mean:
Regular Visitor

## 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

Community Support

Hi @Dineshraj03 ,

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

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.

Announcements

#### Launching new user group features

Learn how to create your own user groups today!