cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Day number of year

Trying to find the syntax for to return a numer out of 1-365 for what number of day in year it is vs just knowing the number in the month  

1 ACCEPTED SOLUTION

@Anonymous

 

You can also add a calcualted column in DAX.

 

DayNoOfYear =
DATEDIFF ( DATE ( YEAR ( 'Table'[Date] ), 1, 1 ), 'Table'[Date], DAY ) + 1

Capture.PNG

View solution in original post

5 REPLIES 5
Solution Sage
Solution Sage

Check out the Date.DayOfYear formula. You would use this in the query editor to add a new column, either as a custom column using the formula, or the simple way through the UI: select your date column, then to go the Add Column tab in the ribbon and use the drop-down on Date to select Day > Day of Year.

@Anonymous

 

You can also add a calcualted column in DAX.

 

DayNoOfYear =
DATEDIFF ( DATE ( YEAR ( 'Table'[Date] ), 1, 1 ), 'Table'[Date], DAY ) + 1

Capture.PNG

View solution in original post

Hello,

 

I was able to use this solution to calculate the day number of the year. I was wondering if anybody had any ideas on how to calculate this for a fiscal year and account for the leap year?

 

My organizations fiscal year starts in October. I was able to use the DAX formula below to calculate the fiscal day number of the year but when leap years occur the formula does not calculate correctly. 

 

FiscalDayoftheYear = IF('Date'[DayofhtheYear]>273,'Date'[DayofhtheYear]-273,'Date'[DayofhtheYear]+92)

 

If anyone has any ideas that would be great! Thanks!

Anonymous
Not applicable

Did you ever digure it out? Got the same problem.

I have to calculate Day number of Quarter and Day number of Month help me please.

Helpful resources

Announcements
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Microsoft Ignite

Microsoft Ignite with Arun Ulag

Featured Session: Drive Data Culture with Power BI- Vision, Strategy & Roadmap. Register here https://myignite.microsoft.com #MSIgnite #PowerPlatform #Power BI ​

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors