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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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