Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
I want to restrict data of all previous years till the month last month selected in the date slicer suppose the last month selected is june 2021 in the date slicers so all the years should show data till June only
Got the solution
Created a disconnected date table and used the following measure
Sales =
@Sumit626 , If you need lytd
LYTD =
var _max1 = if(isfiltered('Date'),MAX( 'Date'[Date]) , today())
var _max = eomonth(Date(Year(_max1)-1, Month(_max1), Day(_max1)),-1)
var _min = eomonth(_max,-1*MONTH(_max))+1
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))
if you want control measure till last year
LYTD =
var _max1 = if(isfiltered('Date'),MAX( 'Date'[Date]) , today())
var _max = eomonth(Date(Year(_max1)-1, Month(_max1), Day(_max1)),-1)
var _min = eomonth(_max,-1*MONTH(_max))+1
return
CALCULATE([net] ,filter(Date,'Date'[Date]>= _min && 'Date'[Date]<= _max))
I need all the previous year not just the last year
And reference should not be today() it should be the max month selected in date slicer
User | Count |
---|---|
84 | |
80 | |
72 | |
71 | |
55 |
User | Count |
---|---|
108 | |
106 | |
93 | |
85 | |
67 |