Forum Discussion
Switto
Helper IV
5 years agocreating quarters from Period
Hi All, I am trying to get the Quater no. from my calendar table. I am using below formula but getting error, stating "Cannot convert value 'P2' of type Text to type True/False.". FY QTR...
- 5 years ago
Switto , Try like
FY QTR = 'EY calendar'[Date].[Year]&"-Q"&IF('EY calendar'[Period] in {"P1","P2","P3"},1,'EY calendar'[Date].[Year]&"-Q"&IF('EY calendar'[Period] in {"P4","P5","P6"},2,'EY calendar'[Date].[Year]&"-Q"&IF('EY calendar'[Period] in {"P7","P8","P9"},3,4)))Better try Switch
FY QTR = 'EY calendar'[Date].[Year]&"-Q"& Switch( true() , 'EY calendar'[Period] in {"P1","P2","P3"},1, 'EY calendar'[Period] in {"P4","P5","P6"},2, 'EY calendar'[Period] in {"P7","P8","P9"},3,4)
amitchandak
Super User
5 years agoSwitto , Try like
FY QTR = 'EY calendar'[Date].[Year]&"-Q"&IF('EY calendar'[Period] in {"P1","P2","P3"},1,'EY calendar'[Date].[Year]&"-Q"&IF('EY calendar'[Period] in {"P4","P5","P6"},2,'EY calendar'[Date].[Year]&"-Q"&IF('EY calendar'[Period] in {"P7","P8","P9"},3,4)))
Better try Switch
FY QTR = 'EY calendar'[Date].[Year]&"-Q"&
Switch( true() ,
'EY calendar'[Period] in {"P1","P2","P3"},1,
'EY calendar'[Period] in {"P4","P5","P6"},2,
'EY calendar'[Period] in {"P7","P8","P9"},3,4)
Switto
Helper IV
5 years agoThanks Amit, It worked. I have changed the column FY QTR to text and it worked.
Thanks for the input.
- amitchandak5 years ago
Super User
Thanks for the update. Can you accept a solution?