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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
grantadmin
New Member

Create column for custom unequal periods for date table

Hello,

I am trying to create a column on my date table that has periods of unequal length. I have created a table using CALENDAR for dates 1/01/2021 - 12/31/2023.

The periods I need to add are:

P11/1/2021 - 12/31/2021
P21/1/2022 - 3/31/2022
P34/1/2022 - 6/30/2022
P47/1/2022 - 9/30/2022
P510/1/2022 - 12/31/2022
P61/01/2023 - 3/31/2023
P74/01/2023 - 6/30/2023
P807/01/2023 - 09/30/2023
P910/01/2023 - 12/31/2023

 

The first period is 1 yr, and the rest are 3 months. 

If anyone has any insight, I would greatly appreciate it.

Thank you.

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@grantadmin 

Create a table in your model for the period, then add a column with the following DAX in the Calendar Table:

Period = 
VAR __Date = 'Calendar'[Date]
RETURN
    CALCULATE(
        MAX( Periods[Period] ),
         __Date >= Periods[Start],
        __Date <= Periods[End] 
    )

Fowmy_0-1701806690283.png


File is attached below 

 







Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

2 REPLIES 2
Fowmy
Super User
Super User

@grantadmin 

Create a table in your model for the period, then add a column with the following DAX in the Calendar Table:

Period = 
VAR __Date = 'Calendar'[Date]
RETURN
    CALCULATE(
        MAX( Periods[Period] ),
         __Date >= Periods[Start],
        __Date <= Periods[End] 
    )

Fowmy_0-1701806690283.png


File is attached below 

 







Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

This worked, thank you!

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.