Forum Discussion
Anonymous
4 years agoNot applicable
DAX Comparing counts from two different snapshots
Hi all, This should be quite straightforward, but I can't seem to be able to debug it yet... I have a series of data called 'Opportunities' that are recorded in an excel spreadsheet. Opp...
- 4 years ago
Hi Anonymous ,
I'm not sure what you want to achieve:
Do you want to compare the values between the LATEST day available in a table and a day you choose in a slicer?
If so:
LatestDateCount = VAR LatestDate = MAXX ( ALL ( 'Table' ), 'Table'[Date Captured] ) VAR LatestDateCount = CALCULATE ( [Opportunties_Count], 'Table'[Date Captured] = LatestDate ) RETURN LatestDateCountEarlierDateCount = VAR EarlierDate = SELECTEDVALUE ( 'Table'[Date Captured] ) VAR EarlierDateCount = CALCULATE ( [Opportunties_Count], 'Table'[Date Captured] = EarlierDate ) RETURN EarlierDateCountIf this post helps, then please consider Accept it as the solution ✔️to help the other members find it more quickly.
ERD
Community Champion
4 years agoHi Anonymous ,
I'm not sure what you want to achieve:
Do you want to compare the values between the LATEST day available in a table and a day you choose in a slicer?
If so:
LatestDateCount =
VAR LatestDate = MAXX ( ALL ( 'Table' ), 'Table'[Date Captured] )
VAR LatestDateCount = CALCULATE ( [Opportunties_Count], 'Table'[Date Captured] = LatestDate )
RETURN
LatestDateCount
EarlierDateCount =
VAR EarlierDate = SELECTEDVALUE ( 'Table'[Date Captured] )
VAR EarlierDateCount = CALCULATE ( [Opportunties_Count], 'Table'[Date Captured] = EarlierDate )
RETURN
EarlierDateCount
If this post helps, then please consider Accept it as the solution ✔️to help the other members find it more quickly.