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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
M_SBS_6
Helper V
Helper V

Financial Year calculating wrong years

Hi, 
I am using the code below to try and work out the financial year, and for the output to be YY/YY.  It appears to be doing that but upon closer inspection, the actual year output is incorrect in some instances and I can't understand why. 

For surv_apps[surv_date] I have, as an example, 31/01/2020 which should have a financial year 19/20 but the output is 20/21. I have tried to pay around with the +1 and -1 but can't get it to output the correct FY.

Can anyone tell me please what it is that I need to amend?

SWITCH (
    TRUE (),
    ISBLANK ( surv_apps[surv_date] ), BLANK (),
    surv_apps[surv_start_month_no] = 4 && MONTH ( surv_apps[surv_date] ) >= 4, 
		FORMAT ( surv_apps[surv_date], "YY" ) & "/" & FORMAT ( surv_apps[surv_date], "YY" ) * 1 + 1,
    surv_apps[surv_start_month_no] = 4, 

 

2 REPLIES 2
v-jayw-msft
Community Support
Community Support

Hi @M_SBS_6 ,

 

Please check the post about How to Get Your Question Answered Quickly - Microsoft Power BI Community.

 

 

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
MahyarTF
Memorable Member
Memorable Member

Hi @M_SBS_6 ,

Would I ask you to put your complete Dax code here?

Also, why did you put And in the fourth line, it means that it will be true just for month = 4

Mahyartf

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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