Forum Discussion
Fiscal year
Hello,
Fiscal year starts April, I tried the formula below but I am getting an error message:
Column 2 = if(QUARTER(PowerBi[Document Date].[Quarter])>=2,QUARTER(PowerBi[Document Date].[Quarter])-1,QUARTER(PowerBi[Document Date].[Quarter])+1)
The error message is: Cannot convert Qrt 1 of Type Test to type Date.
I feel like I am missing something. Please help.
Thank you!
The QUARTER function expects a date, but you're passing in the quarter from the date hierarchy. Try
Column 2 = IF ( QUARTER ( PowerBi[Document Date].[Date] ) >= 2, QUARTER ( PowerBi[Document Date].[Date] ) - 1, QUARTER ( PowerBi[Document Date].[Date] ) + 1 )Yep, that should give the right result I think
7 Replies
- johnt75
Super User
The QUARTER function expects a date, but you're passing in the quarter from the date hierarchy. Try
Column 2 = IF ( QUARTER ( PowerBi[Document Date].[Date] ) >= 2, QUARTER ( PowerBi[Document Date].[Date] ) - 1, QUARTER ( PowerBi[Document Date].[Date] ) + 1 ) - djreyes
Helper I
It worked, question though, I am running a report from January to March which is Quarter 1 for calendar year, but in our fiscal year its quarter 4. Its giving me the result of 2 instead of 4.
- johnt75
Super User
Try
Column 2 = VAR CalendarQuarter = IF ( QUARTER ( PowerBi[Document Date].[Date] ) >= 2, QUARTER ( PowerBi[Document Date].[Date] ) - 1, QUARTER ( PowerBi[Document Date].[Date] ) + 1 ) VAR FiscalQuarter = MOD ( CalendarQuarter + 3, 4 ) RETURN FiscalQuarter- djreyes
Helper I
Is giving me 1 not 4.