Forum Discussion
DAX for Measure/Calculated Column to identify time period selection slicer
- Anonymous4 years ago
Hi Anonymous ,
Here are the steps you can follow:
1. Create measure.
Flag = var _select=SELECTEDVALUE('Sales'[Market]) var _maxdate=MAXX(FILTER(ALL(Sales),'Sales'[Market]=_select),[Date]) return IF( MAX('Sales'[Date]) > EOMONTH(_maxdate,-4) &&MAX('Sales'[Date])<=_maxdate,1,0)2. Place [Flag]in Filters, set is=1, apply filter.
3. Result:
When no slicer is selected, a 3-month interval is displayed for each market
Select slicers to display the interval for the specified Market for 3 months
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi Anonymous ,
Here are the steps you can follow:
1. Create measure.
Flag =
var _select=SELECTEDVALUE('Sales'[Market])
var _maxdate=MAXX(FILTER(ALL(Sales),'Sales'[Market]=_select),[Date])
return
IF(
MAX('Sales'[Date]) > EOMONTH(_maxdate,-4) &&MAX('Sales'[Date])<=_maxdate,1,0)
2. Place [Flag]in Filters, set is=1, apply filter.
3. Result:
When no slicer is selected, a 3-month interval is displayed for each market
Select slicers to display the interval for the specified Market for 3 months
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly