Forum Discussion
Dynamically compare snapshots: before vs. after
Hi michaelsh ,
According to what I have learned, it seems difficult to do without creating this crossjoin tables.
I thought about it for a long time before I came up with crossjoin.😁
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you, Anonymous !
I appreciate your help.
If no one shows up with the dynamic measure idea, I'll mark yours as a solution.
- Anonymous5 years agoNot applicable
Hi michaelsh ,
Sorry to disturb you...Please mark my reply as solution. Thank you very much.
Best Regards,
Stephen Tao- michaelsh5 years ago
Kudo Kingpin
I actually have an alternative - dynamic solution, but I haven't tested it yet.
M1 = VAR vSelectedDateBefore = SELECTEDVALUE ( SnapshotDateBefore[SnapshotDate], MIN ( SnapshotDateBefore[SnapshotDate] ) ) VAR vSelectedDateAfter = SELECTEDVALUE ( SnapshotDateAfter[SnapshotDate], MAX ( SnapshotDateAfter[SnapshotDate] ) ) RETURN COUNTROWS ( FILTER ( ADDCOLUMNS ( VALUES ( Data[Employee] ), "cBeforeFl", CALCULATE ( NOT ( ISEMPTY ( Data ) ), Data[SnapshotDate] = vSelectedDateBefore, Data[AttributeValue] IN VALUES ( DepartmentBefore[AttributeValue] ) ), "cAfterFl", CALCULATE ( NOT ( ISEMPTY ( Data ) ), Data[SnapshotDate] = vSelectedDateAfter, Data[AttributeValue] IN VALUES ( DepartmentAfter[AttributeValue] ) ) ), [cBeforeFl] && [cAfterFl] ) )