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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
MQUINT-07
Regular Visitor

Custom Calendar fiscal year october

i want to create a day number on DAX Calendar.

 

we have a custom calendar for fiscal year, our fiscal year stars on october 1 and i want to create a column when day #1 are october first, 2 october second...

 

could you please help?, i alredy try trhu date dif:

 

daynum#FIX = DATEDIFF ( DATE ( YEAR ('Calendario End Date'[Date]),10,1 ), 'Calendario End Date'[Date], DAY ) + 1
 

but when function comes to 1jan retun -273 

 

MQUINT07_0-1657127010902.png

MQUINT07_1-1657127049879.png

 

thanks in advance for the help

 

1 ACCEPTED SOLUTION

Hello Thanks for your help.

 

its help me to find the way, the solve it´s the following:

 

daynum#FIX2 = IF('Calendario End Date'[Date] >= DATE(YEAR('Calendario End Date'[Date]),10,1),DATEDIFF(DATE(YEAR('Calendario End Date'[Date]),10,1),'Calendario End Date'[Date],DAY)+1,DATEDIFF (DATE(YEAR('Calendario End Date'[Date]),1,1), DATEADD('Calendario End Date'[Date],92,DAY), DAY ) + 1)
 
i was to use an if function to declare when it will the first day of the year (1 oct) and use 2 function 1 for dates after 1 oct and dates before.

i really apreciate your time.
 
best regards.
 
 

View solution in original post

5 REPLIES 5
technolog
Super User
Super User

You need to change number of YEAR 

technolog_0-1657127404527.png

 

In your case you get current YEAR number but you need to use DATEADD and move start of the year.

You need to try something like this:

daynum#FIX = DATEDIFF ( DATE ( DATEADD( YEAR ('Calendario End Date'[Date]),10,1 ) , XXX, DAY), 'Calendario End Date'[Date], DAY ) + 1
 
where XXX - the number of days that you change you from calendar year.

i trayed but its still remarkme error, 

 

daynum#FIX2 = DATEDIFF (DATEADD('Calendario End Date',273,DAY), 'Calendario End Date'[Date], DAY ) + 1
 
MQUINT07_0-1657130576651.png

thanks for your support.

 

best regards.

try add

daynum#FIX2 = DATEDIFF (DATEADD('Calendario End Date'[Date],273,DAY), 'Calendario End Date'[Date], DAY ) + 1

Hello Thanks for your help.

 

its help me to find the way, the solve it´s the following:

 

daynum#FIX2 = IF('Calendario End Date'[Date] >= DATE(YEAR('Calendario End Date'[Date]),10,1),DATEDIFF(DATE(YEAR('Calendario End Date'[Date]),10,1),'Calendario End Date'[Date],DAY)+1,DATEDIFF (DATE(YEAR('Calendario End Date'[Date]),1,1), DATEADD('Calendario End Date'[Date],92,DAY), DAY ) + 1)
 
i was to use an if function to declare when it will the first day of the year (1 oct) and use 2 function 1 for dates after 1 oct and dates before.

i really apreciate your time.
 
best regards.
 
 

Helpful resources

Announcements
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.