March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello
Within the calendar table, am wanting to add a column with following conditions. Assume today is 5/7/2020
Prior to or equal to today = "valid"
Prior to current EOM - in this case 5/31/20 - return "EOM"
Dates >current EOM or>= 6/1/20 return "Future"
As you can see in screenshot below, the first if statement is properly evaluated <= today() = "Valid", the else part of the second if statement should be returning "Future"
DateTrue =
IF (
'CALENDAR'[Date] <= TODAY (),
"Valid",
IF ( 'CALENDAR'[Date] <= EOMONTH ( 'CALENDAR'[Date], 0 ), "EOM", "Future" )
)
I have tried various flavors of the EOM, EndOfMonth, and EOMonth functions - with mostly same result.
Always appreciate the help! Please disregard the "red" question mark, I was thinking today was May 8th, not 7th.
Solved! Go to Solution.
Hi @Dellis81 ,
Try this one:
Hi @Dellis81 ,
You can use the Switch () function
Thank you for your quick reply - I did attempt the switch function - but have never completely understood the true componet, This will help me! thanks!
Please see this video to understand SWITCH() function better.
https://www.youtube.com/watch?v=-ykkaAtlCMc
Regards,
Harsh Nathani
A calculated column is calculated only when the data is loaded. So, unless you plan to always load the data each morning, the logic will not hold for future days.
The second issue is that these 2 categories overlap
Prior to or equal to today = "valid"
Prior to current EOM - in this case 5/31/20 - return "EOM"
5/6 is both prior to or equal to today
and
prior to current EOM
for this condition Dates >current EOM or>= 6/1/20 return "Future"
you don't need to test after the or... dates that are greater than EOM and by definiton >= the first day of the next month
I've made some assumptions about what you really want and written this measure
Help when you know. Ask when you don't!
Hi @Dellis81 ,
Try this one:
Perfect - thank you! So simple, once somebody else shows me...
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
134 | |
91 | |
90 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
72 | |
68 |