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.
Hi,
I am trying to add a filter to my visuals in a report.
I want to see the last 4 years + YTD.
If I choose last 5 calendar years I don't get current year.
If I choose last 5 years I don't get the full last year, but rather a rolling 12 months period.
This was an attempt that I tried. Can't understand what goes wrong. I tried just creating an empty table and see which values get 1, and 2023 isn't getting any values to it. What am I doing wrong?
Is YTD or Last 4 Yrs =
VAR vToday = TODAY ()
VAR vYearOffset = 4
VAR vCurYear = YEAR ( vToday )
VAR vStartYear = vCurYear - vYearOffset
VAR vResult = IF (YEAR ( MAX ( 'Date Dimension'[Date] ) ) >= vStartYear && MAX ( 'Date Dimension'[Date] ) <= vToday;
1;
0)
RETURN vResult
Hi,
Share some data and show the expected result.
@Menvf ,Try a measure like
YTD Today +4 =
var _min = date(year(today()) -4,1,1)
var _max = today()
return
CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max)) // assuming you are using date table or use date from table
@amitchandak thank you for your effort, however it still doesn't work even when I change the date reference.
What is the [Net] reference in the calculate?
User | Count |
---|---|
77 | |
75 | |
67 | |
65 | |
47 |
User | Count |
---|---|
108 | |
106 | |
93 | |
84 | |
66 |