Forum Discussion
Anonymous
5 years agoNot applicable
MAT Calculation
Dear Power BI Community, I would like to calculate a MAT using a DAX formula but I would need you help. MAT calculation would be from now (year 2021) over the last 13 periods and would like to calc...
- 5 years ago
Hi Anonymous ,
Sorry, it was an oversight on my part and I have adjusted the relevant measure😋:
Percentage22 = DIVIDE ( (CALCULATE ( COUNTA ( 'rclms_qa'[CONFORMITY] ), FILTER ( ALL(rclms_qa), rclms_qa[Period] = MAX ( rclms_qa[Period] ) && rclms_qa[Year] = MAX ( rclms_qa[Year] ) ) ) - CALCULATE ( COUNTA ( 'rclms_qa'[CONFORMITY] ), FILTER ( ALL(rclms_qa), rclms_qa[Period] = IF ( INT ( VALUE ( RIGHT ( MAX ( rclms_qa[Period] ), 2 ) ) + 1 ) < 10 || INT ( VALUE ( RIGHT ( MAX ( rclms_qa[Period] ), 2 ) ) + 1 ) = 14, "P" & "0" & IF ( INT ( VALUE ( RIGHT ( MAX ( rclms_qa[Period] ), 2 ) ) + 1 ) = 14, 1, INT ( VALUE ( RIGHT ( MAX ( rclms_qa[Period] ), 2 ) ) + 1 ) ), "P" & INT ( VALUE ( RIGHT ( MAX ( rclms_qa[Period] ), 2 ) ) + 1 ) ) && rclms_qa[Year] =IF ( INT ( VALUE ( RIGHT ( MAX ( rclms_qa[Period] ), 2 ))) =13, MAX ( rclms_qa[Year] ), MAX ( rclms_qa[Year] ) - 1) ) )), CALCULATE ( COUNTA ( 'rclms_qa'[CONFORMITY] ), ALL ( 'rclms_qa') ) ) * 100YEARTEST = IF ( INT ( VALUE ( RIGHT ( MAX ( rclms_qa[Period] ), 2 ) ) )=13, MAX ( rclms_qa[Year] ), MAX ( rclms_qa[Year] ) - 1)Best Regards
Lucien
v-luwang-msft
Community Support
5 years agoHi Anonymous ,
I don't see the fields in the slicer in the data you provided earlier, is it convenient to provide the pbix file, remember to delete the confidential data.
Best Regards
Lucien