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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
jessyssej
Frequent Visitor

Date Hierarchy - Splitting my week into two separate years

 
 

jessyssej_0-1596144029565.png

 

I created a Date Hierarchy to look at Calendar Year, followed by Pay Period (2 weeks or 26 in a year) everything works great! EXCEPT for the split of the pay period that falls under 2 different calendar years.    Any thoughts?

This is what I used for the Pay Period =

Pay Period Number = MOD (

     FLOOR (

        DATEDIFF(DATE(2019,12,30),'Calendar'[Date],DAY)/14,

        1

    ),

    26

) +1

 

 

4 REPLIES 4
amitchandak
Super User
Super User

@jessyssej , to deal with such case you need to use the period year. not a calendar year. This same problem with week also. Either period start date or period enda= date should decide the period, no the date

This sounds interesting, would this be added to my calendar table?  Measure?

 

mahoneypat
Employee
Employee

Assuming that pay period truly does wrap around between 2019 and 2020, the simplest would be to remove the Year from your hierarchy.  Or you could make a new column in your Calendar table that captures all needed info in a single value (Year and Pay Period).

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Thanks for your reply.  I don't really want to remove the year, in fact I've been asked to add Fiscal year which will make it that much more complicated.  I thought about creating a column with all the values but I'm not in love with that option yet.  Thanks again!

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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