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
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
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.

Top Solution Authors