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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
TapZxK
Helper II
Helper II

Calendar - How to split a month in 2 Periods (Newbie looking for help)

Hi Guys, 

 

I have finally created a calendar table that is aligned with my organizations Fiscal Year.

Huge shout-out to @amitchandak for helping with that task. 

 

Now I would like to create a column that would represent a Month Period. 

 

Our months in the organization are split in to 2 periods. 

1st Period runs from the 1st of the month until 15th of the month.

2nd Period runs from the 16th of the month until end of that month. 

for example:

 

01.01.2020 - 15.01.2020 = January, Period 1

16.01.2020 - 31.01.2020 = January, Period 2

01.02.2020 - 15.02.2020 = February, Period 1

16.02.2020 - 29.02.2020 = February, Period 2

 

I was wondering if there is a way to create a column in my calendar that would split the months in to these periods? 

 

I would like for the column to be represented as such:

Reporting Period

February P1

February P2

March P1

March P2

April P1

April P2

etc.

 

My Fiscal Year Starts on 1st of September and Ends on 31st of August (If that helps)

 

My Current Calendar Table:

 

My Current Calendar TableMy Current Calendar Table

 

Best Regards,

Kris

1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

Hi @TapZxK 

try to create a calculated column

Reporting Period = 
var _period = IF(DAY('CalendarTable'[Date])<16," P1"," P2")
RETURN
CONCATENATE(FORMAT(CalendarTable[Date],"mmmm"),_period)

 

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

3 REPLIES 3
az38
Community Champion
Community Champion

Hi @TapZxK 

try to create a calculated column

Reporting Period = 
var _period = IF(DAY('CalendarTable'[Date])<16," P1"," P2")
RETURN
CONCATENATE(FORMAT(CalendarTable[Date],"mmmm"),_period)

 

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Hi @az38,

 

Worked like a charm. 

Thank you very much. 

 

When I think about the logic behind this DAX it's actualy very simple.

It's just knowing how to express this logic in DAX that is what's challenging for me at the moment. 

 

Much appreciated.

 

BR,

Kris

az38
Community Champion
Community Champion

@TapZxK 

practice, practice, practice.. 

if you will struggling with smth - we will glad to help you

 

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors