Forum Discussion
Anonymous
3 years agoNot applicable
Find the acc missing and newly added
Hi all, Source R_Date Acc C 2022-Jul 123 B 2022-Aug 321 C 2022-Aug 1234 Using the table I wanna find out, Acc missing in August and Accounts newly added in August....
v-jianboli-msft
Community Support
3 years agoHi Anonymous ,
Please try:
First create two table visual.
Then create two measures:
Added =
VAR _a =
CALCULATE (
COUNT ( 'Table'[Acc] ),
FILTER (
ALL ( 'Table' ),
[Acc] = MAX ( 'Table'[Acc] )
&& [R_Date] > EOMONTH ( MAX ( 'Table'[R_Date] ), 0 )
)
)
VAR _b =
EOMONTH ( CALCULATE ( MIN ( 'Table'[R_Date] ), ALL ( 'Table' ) ), 0 )
VAR _c =
CALCULATE (
COUNT ( 'Table'[Source ] ),
FILTER ( ALL ( 'Table' ), [Source ] = MAX ( 'Table'[Source ] ) )
)
RETURN
IF ( MAX ( 'Table'[R_Date] ) > _b && ISBLANK ( _a ) && _c > 1, 1, 0 )
Missing =
VAR _a =
CALCULATE (
COUNT ( 'Table'[Acc] ),
FILTER (
ALL ( 'Table' ),
[Acc] = MAX ( 'Table'[Acc] )
&& [R_Date] > EOMONTH ( MAX ( 'Table'[R_Date] ), 0 )
)
)
VAR _b =
EOMONTH ( CALCULATE ( MAX ( 'Table'[R_Date] ), ALL ( 'Table' ) ), -1 )
RETURN
IF ( MAX ( 'Table'[R_Date] ) <= _b && ISBLANK ( _a ), 1, 0 )
Apply them to the two visual's filter separately:
Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.