Forum Discussion
How to compare two date columns on the same chart
- 9 years ago
We can create a measure to get the difference of two selected dates.
Difference = CALCULATE ( SUM ( Table1[Value] ), FILTER ( ALLSELECTED ( Table1[Date] ), Table1[Date] = MAX ( Table1[Date] ) ) ) - CALCULATE ( SUM ( Table1[Value] ), FILTER ( ALLSELECTED ( Table1[Date] ), Table1[Date] = MIN ( Table1[Date] ) ) )However, We can't have this measure appeared on Grand Total level only. It will always appear under each column group.
So I suggest you create another table visual, and bring Region field and Difference measure only.
Regards,
We can create a measure to get the difference of two selected dates.
Difference =
CALCULATE (
SUM ( Table1[Value] ),
FILTER ( ALLSELECTED ( Table1[Date] ), Table1[Date] = MAX ( Table1[Date] ) )
)
- CALCULATE (
SUM ( Table1[Value] ),
FILTER ( ALLSELECTED ( Table1[Date] ), Table1[Date] = MIN ( Table1[Date] ) )
)
However, We can't have this measure appeared on Grand Total level only. It will always appear under each column group.
So I suggest you create another table visual, and bring Region field and Difference measure only.
Regards,
Hi Simon,
the measure did not work, It didn't create two column dates. How did you add the spelled out date on the top of column header? did you specify dates in the mesure? from the Revenue table I selected the highlighted columns below.
Difference =
CALCULATE (
SUM ( Revenue[Revenue in USD] ),
FILTER ( ALLSELECTED ( Revenue[As of Date] ), Revenue[As of Date] = MAX ( Revenue[As of Date] ) ))
- CALCULATE (
SUM ( Revenue[Revenue in USD] ),
FILTER ( ALLSELECTED ( Revenue[As of Date] ), Revenue[As of Date] = MIN ( Revenue[As of Date] ) ) )
Thanks,
Sam