Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet 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
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:
P1 | 1/1/2021 - 12/31/2021 |
P2 | 1/1/2022 - 3/31/2022 |
P3 | 4/1/2022 - 6/30/2022 |
P4 | 7/1/2022 - 9/30/2022 |
P5 | 10/1/2022 - 12/31/2022 |
P6 | 1/01/2023 - 3/31/2023 |
P7 | 4/01/2023 - 6/30/2023 |
P8 | 07/01/2023 - 09/30/2023 |
P9 | 10/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.
Solved! Go to Solution.
@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]
)
File is attached below
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@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]
)
File is attached below
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
This worked, thank you!
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
90 | |
84 | |
70 | |
49 |
User | Count |
---|---|
143 | |
121 | |
112 | |
58 | |
57 |