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