Forum Discussion
Relative difference plot of time series data when sliced by different dates
Thank you for the help! I have gotten very close to implementation of this solution. However, I am stuck on this code:
ALLSELECTED('Date'[Date])
Uncertain on how to reference a date slicer. I believe you referenced it here: create a measure that calculates the minimum date selected in the slicer.
Many thanks again
Hello powerBAMbi,
The ALLSELECTED('Date'[Date]) function is used to reference the date slicer in the measure.
To reference a date slicer in Power BI, you need to replace Date in the expression ALLSELECTED('Date'[Date]) with the name of the date column that you're using in the slicer.
Min_Date_Selected = MINX(FILTER('Y_Values', ALLSELECTED('Y_Values'[tm_stamp])), 'Y_Values'[tm_stamp])
This measure uses the ALLSELECTED function to reference the date slicer and filter the dataset based on the selected date range. It then uses the FILTER function to apply the filter to the tm_stamp column in the Y_Values table.
The MINX function is used to return the minimum date value from the filtered dataset. This value is assigned to the Min_Date_Selected variable.
With this measure, you can calculate the minimum date value selected in the date slicer and use it in your difference measure to calculate the baseline value.
Let me know if you might need further guidance.