Forum Discussion
switch using date ranges
Anonymous , Formula seems fine. The only doubt I have is that either Month of year is of data type text.
Can you share a sample pbix after removing sensitive data?
- Anonymous5 years agoNot applicable
I can't send the pbix. However here is a screen shot - YEAR is the same type.
I have also tried this
- amitchandak5 years agoSuper User
Anonymous , do not use MAX as this column max will take max date. Also, remove values
like
Switch(true(),
Date[Month] = 8 && Date[Year] =2009 , 1,
Date[Month] = 11 && Date[Year] =2009 , 2
)
Also in case you trying some custom financial calendar refer my blog
- Anonymous5 years agoNot applicable
amitchandak Thank you - I cleaned it up a bit. Its not seeing the second line where month = 11 and month = 4. Its only giving results as Sprintnumber 1 and sprint number 3. When month = 11 or greater, it doesn't give the result sprintnumber 2
- Anonymous5 years agoNot applicable
Here is the DATE table - how I created it.
- Anonymous5 years agoNot applicable
I didn't get any errors using this (I changed the way the calendar table was created - using
Date Table = CALENDAR(Date (2018, 1, 1), DATE( 2022, 12, 31))Then I used this method: BUT I didn't get ANY results. - Anonymous5 years agoNot applicable
Hello! - I'm making progress but still not there - The below function is not giving any errors, but Its giving a "1" for starting 8/1/2019 but NOT giving a "2" for the respective dates. It IS returning a "3" for dates starting 1/1/2020. Not sure what its not giving a 2 or 4