Forum Discussion
SushmaReddy
4 years agoHelper I
Count Distinct from latest records
Max Date = Var mat= T1[Mat1] return MAXX( FILTER(ALL(T1),T1[M1]=mat),(T1[Date])) to get max date records Another Column to get the count of failed records # Error = IF(And(T1[Date]=T1[M...
- 4 years ago
Hi SushmaReddy ,
You can try this code:
Measure = VAR _s = SUMMARIZE ( 'Table', [M1], "max", MAX ( 'Table'[Date] ), "status", CALCULATE ( MAX ( 'Table'[Status] ), FILTER ( 'Table', 'Table'[M1] = EARLIER ( 'Table'[M1] ) ) ) ) RETURN COUNTROWS ( FILTER ( _s, [status] = "Failed" ) )Pbix in the end you can refer.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- 4 years ago
Thank you and the logic is working
v-chenwuz-msft
4 years agoCommunity Support
Hi SushmaReddy ,
You can try this code:
Measure =
VAR _s =
SUMMARIZE (
'Table',
[M1],
"max", MAX ( 'Table'[Date] ),
"status",
CALCULATE (
MAX ( 'Table'[Status] ),
FILTER ( 'Table', 'Table'[M1] = EARLIER ( 'Table'[M1] ) )
)
)
RETURN
COUNTROWS ( FILTER ( _s, [status] = "Failed" ) )
Pbix in the end you can refer.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- SushmaReddy4 years agoHelper I
Thank you and the logic is working