Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
Can someone please help me to modify this date table? I am looking for this date table to end dynamically at the end of last month rather than full year.
DATE =
VAR MINYEAR = (YEAR(TODAY())) - 4
VAR MAXYEAR = YEAR(TODAY())
--VAR MAXMONTH = if (YEAR(TODAY() = 2022 MONTH(TODAY())-1
return
ADDCOLUMNS(
FILTER(
CALENDARAUTO(),
YEAR ( [DATE]) >= MINYEAR && YEAR ( [DATE]) <= MAXYEAR
),
"Year", YEAR([Date]),
"Month", MONTH([Date]),
"YearMonth", FORMAT([Date],"yyyymm"),
"Month Label", FORMAT([Date],"mmm"),
"QKey", QUARTER([Date])
)
Thanks,
RK
Solved! Go to Solution.
Thanks. I had to just modify your formula a little bit to make it work. Thanks for your help.
CALENDAR( DATE( YEAR(TODAY())-4,1,1), EOMONTH(TODAY(), -1)),
Instead of CALENDARAUTO and filtering on years you could try CALENDAR( DATE( YEAR(TODAY()-4),1,1), EOMONTH(TODAY(), -1))
Thanks. I had to just modify your formula a little bit to make it work. Thanks for your help.
CALENDAR( DATE( YEAR(TODAY())-4,1,1), EOMONTH(TODAY(), -1)),
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
99 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
110 | |
91 | |
84 | |
66 |