Forum Discussion
ConnorH
Microsoft Employee
6 years agoFirst post need help with case statement
Hi all, This is my first post on here so if I am not posting in the right spot splease direct me. I am use to writing SQL queries but my current job does not have a data base structure so I have ...
ibarrau
Super User
6 years agoHi. I don't think you can use between in switch. It only asks for one value. You should get if from if from if. Like this:
IF(
AND( Table[StartDate] > DATE(1,7,2018) , Table[StartDate] < DATE(21,9,2018) ),
"FY19-Q1",
IF(
AND( Table[StartDate] > DATE(24,9,2018) , Table[StartDate] < DATE(21,12,2018) ),
"FY19-Q2",
IF(
AND( Table[StartDate] > DATE(31,12,2018) , Table[StartDate] < DATE(22,3,2018) ),
"FY19-Q3",
"Find QTR"
)
)
)
You should also try creating a Calendar Fiscal Date Table. It's like a regular calendar table but with the months and quarters of your business configured.
Hope this helps,