Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

Fiscal quarter calculation bug

I am running PowerBI Desktop version 2.71.5523.821 64-bit. I use the following query below to appropriately name my values. The interesting thing here is any datetime value between 10/1/2018 to 12/30/2018 shows Q2FY18 except for 12/31/2018 shows Q2FY19.
 
Is there something wrong with my query? I created a new column to show me the month number and it looks right.
 
MonthNumber = month(incident_sla[taskslatable_end_time].[Date])
 
Fiscal_Quarter = if((Month(incident_sla[taskslatable_end_time].[Date])=1||Month(incident_sla[taskslatable_end_time].[Date])=2||Month(incident_sla[taskslatable_end_time].[Date])=3),"Q3FY"&RIGHT(YEAR(incident_sla[taskslatable_end_time].[Date]),2),IF((Month(incident_sla[taskslatable_end_time].[Date])=4||Month(incident_sla[taskslatable_end_time].[Date])=5||Month(incident_sla[taskslatable_end_time].[Date])=6),"Q4FY"&RIGHT(YEAR(incident_sla[taskslatable_end_time].[Date]),2),IF((Month(incident_sla[taskslatable_end_time].[Date])=7||Month(incident_sla[taskslatable_end_time].[Date])=8||Month(incident_sla[taskslatable_end_time].[Date])=9),"Q1FY"&RIGHT(YEAR(incident_sla[taskslatable_end_time].[Date]+1),2),IF((Month(incident_sla[taskslatable_end_time].[Date])=10||Month(incident_sla[taskslatable_end_time].[Date])=11||Month(incident_sla[taskslatable_end_time].[Date])=12),"Q2FY"&RIGHT(YEAR(incident_sla[taskslatable_end_time].[Date]+1),2),"Not sure"))))fiscal_quarter_bug.PNG
1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

Try this calculated column formula

=IF(MONTH(incident_sla[taskslatable_end_time])<=3,"Q3FY"&RIGHT(YEAR(incident_sla[taskslatable_end_time]])),IF(MONTH(incident_sla[taskslatable_end_time])<=6,"Q4FY"&RIGHT(YEAR(incident_sla[taskslatable_end_time]])),IF(MONTH(incident_sla[taskslatable_end_time])<=9,"Q1FY"&RIGHT(YEAR(incident_sla[taskslatable_end_time]])+1),"Q2FY"&RIGHT(YEAR(incident_sla[taskslatable_end_time]])+1))))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

Try this calculated column formula

=IF(MONTH(incident_sla[taskslatable_end_time])<=3,"Q3FY"&RIGHT(YEAR(incident_sla[taskslatable_end_time]])),IF(MONTH(incident_sla[taskslatable_end_time])<=6,"Q4FY"&RIGHT(YEAR(incident_sla[taskslatable_end_time]])),IF(MONTH(incident_sla[taskslatable_end_time])<=9,"Q1FY"&RIGHT(YEAR(incident_sla[taskslatable_end_time]])+1),"Q2FY"&RIGHT(YEAR(incident_sla[taskslatable_end_time]])+1))))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
XLBob
Resolver II
Resolver II

For 31 Dec 2018 below formula will give you 2019 becasue (31-Dec-2018)+1=1-Jan-2019

YEAR(incident_sla[taskslatable_end_time].[Date]+1),

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.