Forum Discussion
powerBAMbi
3 years agoNew Member
Relative difference plot of time series data when sliced by different dates
Hello, I am attempting to create a relative difference plot of time series data, but based on the reading of the current date in the date slicer on a page. Using Python, it is relatively simple as bo...
Sahir_Maharaj
Super User
3 years agoHello powerBAMbi,
One approach to achieve the desired result is to create a measure that calculates the minimum date selected in the slicer, and then use that measure as a filter in the DAX formula.
Difference_Value_Relative =
VAR __MIN_DATE =
CALCULATE(
MIN('Y_Values'[tm_stamp]),
ALL('Y_Values'),
ALLSELECTED('Date'[Date])
)
VAR __BASELINE_VALUE =
CALCULATE(
MAX('Y_Values'[Value]),
'Y_Values'[tm_stamp] = __MIN_DATE
)
VAR __MEASURE_VALUE = MAX('Y_Values'[Value])
RETURN
IF(NOT ISBLANK(__MEASURE_VALUE), __MEASURE_VALUE - __BASELINE_VALUE)
This formula should give you the relative difference plot of time series data based on the current date in the date slicer.
Let me know if you might need further guidance.