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
Anonymous
Not applicable

Split the year into six monthly periods

HI All,

 

I have a dataset in Power BI in this format. 

01 Data Set.png

 

 
 

Besides table does NOT have any date field.

So, I can use same method to extract the Year following this link
CONCATENATE, YEAR, MONTH and  DATEVALUE DAX functions to achieve  this.


However, I need to extract 1st Half (Jan - June) and 2nd Half (July - Dec) for that specific year such as 2015, 2016, 2017 etc.

I found some amazing blog to extract Week, Month, and Quarter. But I need six monthly function.
Any inputs will be highly appreciated.

 

Thanks in advance.     

1 ACCEPTED SOLUTION

Create a calculated column,

 

IF(LEFT('Table'[Period],3) = "2nd H1","Jul - Dec","Jan - Jun")

 

Let me know if it works or not.

View solution in original post

7 REPLIES 7
SivaMani
Resident Rockstar
Resident Rockstar

It will be helpful to assist if you share some sample data.

Anonymous
Not applicable

@SivaMani ..Thanks for your reply.

 

Here is part of sample data ..

 

02 Sample Data.png

Correct me if I'm wrong.

Your requirement is,

if the value has 1st half then you wanted to have it Jan - Jun. Right?

 

For example,

 

2nd H1 FY2017 will be Jul - Dec

Anonymous
Not applicable

@SivaMani Excatly! 


There will be 2 columns for user so that can report


  1. Specific Year,  (Date Format), 2017  ( from the dataset 2nd H1 FY2017)  - I already did that part
  2. Specific period, (Text), an indicator that its 2nd H1 for 2017.  

Create a calculated column,

 

IF(LEFT('Table'[Period],3) = "2nd H1","Jul - Dec","Jan - Jun")

 

Let me know if it works or not.

Anonymous
Not applicable

@SivaMani You are superstar ...

 

It worked like breeze   

 

PeriodYear = IF(LEFT(HCM[Period],3) = "2nd", "Jul - Dec", "Jan - Jun")

@Anonymous,

 

Thank you for your appreciation;)

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.