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.
Hi,
I have a calendar table and I want to add a flag for last month end date in the year until today.
Date | Last_end_of_month_in_year |
01/01/2020 | N |
… | |
31/12/2020 | Y |
01/01/2021 | N |
… | |
31/12/2021 | Y |
01/01/2022 | N |
… | |
31/08/2022 | N |
01/09/2022 | N |
30/09/2022 | Y |
01/10/2022 | N |
02/10/2022 |
For 2020, 31/12/2020, for 2021, 31/12/2021 and for 2022, 30/09/2022 should be the last month end dates in the years.
How do I achieve this?
Solved! Go to Solution.
@bml123 So maybe:
Column =
VAR __EOM = EOMONTH(TODAY(),-1)
RETURN
SWITCH(TRUE(),
YEAR([Date]) = YEAR(TODAY()) && [Date] = __EOM,"Y",
[Date] = DATE(YEAR([Date]),12,31),"Y",
"N"
)
@bml123 So like EOMONTH(TODAY(),-1) ?
Hi @Greg_Deckler ,
No, not like that. I have edited my question to make it more clear.
For 2020, 31/12/2020, for 2021, 31/12/2021 and for 2022, 30/09/2022 should be flagged as the last month end dates in the years.
How do I achieve this?
@bml123 So maybe:
Column =
VAR __EOM = EOMONTH(TODAY(),-1)
RETURN
SWITCH(TRUE(),
YEAR([Date]) = YEAR(TODAY()) && [Date] = __EOM,"Y",
[Date] = DATE(YEAR([Date]),12,31),"Y",
"N"
)
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 |
---|---|
109 | |
106 | |
87 | |
76 | |
66 |
User | Count |
---|---|
126 | |
112 | |
99 | |
82 | |
73 |