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

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