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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

MAT Calculation

Dear all,

I'm totally novice using the DAX. I would like to calculate a MAT value from the today (ex. we are in P7) over the last 13 periods.

We will make P7 2021 - P72020

 

YearsPeriods% Grade A
2021P0787,59
2021P0686,78
2021P0587,06
2021P0487,37
2021P0386,17
2021P0286,82
2021P0186,9
2020P1386,64
2020P1286,81
2020P1185,87
2020P1087,58
2020P0987,21
2020P0886,02
2020P0786,44

In this case result is => % diff = 1,15 %

Should appear like this for the actual period (P7) (% is wring in this example):

HerveRC_2020_0-1627647351792.png

And I would like to make a graph with the calculation:

HerveRC_2020_1-1627647415270.png

 

 

% Grade A is calculated like this:

Percentage = DIVIDE(CALCULATE(
COUNTA('rclms_qa'[CONFORMITY]),
ALLSELECTED('rclms_qa'[CONFORMITY])
),CALCULATE(
COUNTA('rclms_qa'[CONFORMITY]),
ALL('rclms_qa'[CONFORMITY])
))*100
 
Thanks a lot for your help,
Hervé
1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
Community Support

Hi @Anonymous ,

 

Try the following formula:

 

Measure = 
[% Grade A] - CALCULATE(
                [% Grade A],
                FILTER(
                    ALLSELECTED(rclms_qa[Years]),
                    rclms_qa[Years] = MAX(rclms_qa[Years]) - 1
                )
            )

image.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.

View solution in original post

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

Hi @Anonymous ,

 

Try the following formula:

 

Measure = 
[% Grade A] - CALCULATE(
                [% Grade A],
                FILTER(
                    ALLSELECTED(rclms_qa[Years]),
                    rclms_qa[Years] = MAX(rclms_qa[Years]) - 1
                )
            )

image.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.

Anonymous
Not applicable

Great - it works. Thanks @v-kkf-msft 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.