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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
ninimoke
Helper I
Helper I

Split Month into Biweekly but Still Remain in Date Format

Help please!!! 

I have a Date column but I want to split the month into bi weekly with DAX(column or measure, not sure the best) but still remain as a date format. Example of what I want to achieve is attached. Thanks.Capture.JPG

3 ACCEPTED SOLUTIONS
ninimoke
Helper I
Helper I

Thanks @Greg_Deckler , I am still new to Power BI, if you can help with the DAX that can achieve that. Thanks.

View solution in original post

@ninimoke Well, I don't know your data so not sure how you segment your months. If all you have is a Date column then perhaps something along the lines of:

Column =
  VAR __Date = [Date]
  VAR __StartOfMonth = DATE(YEAR(__Date), MONTH(__Date), 1)
  VAR __StartWeek = WEEKNUM(__StartOfMonth)
  VAR __CurrentWeek = WEEKNUM(__Date)
RETURN
  IF( (__CurrentWeek - __StartWeek) > 2,"Period 2", "Period 1")

Otherwise, Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

v-yadongf-msft
Community Support
Community Support

Hi @ninimoke ,

 

As  @Greg_Deckler  said, please try following DAX to create new columns:

 

Column 1 = 
VAR __Date = [Date]
VAR __StartOfMonth = DATE(YEAR(__Date), MONTH(__Date), 1)
VAR __StartWeek = WEEKNUM(__StartOfMonth)
VAR __CurrentWeek = WEEKNUM(__Date)
RETURN
IF( (__CurrentWeek - __StartWeek) > 2,"P2", "P1")

Column 2 = FORMAT([Date],"mmm")

 

 

Please create a clustered column chart like below, you can split Month into Biweekly but Still Remain in Date Format:

vyadongfmsft_0-1661766197096.png

 

If I misunderstand your demands, please provide some data screenshots (remember to hide sensitive information) to help us better solve your problem.

 

Best regards,

Yadong Fang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-yadongf-msft
Community Support
Community Support

Hi @ninimoke ,

 

As  @Greg_Deckler  said, please try following DAX to create new columns:

 

Column 1 = 
VAR __Date = [Date]
VAR __StartOfMonth = DATE(YEAR(__Date), MONTH(__Date), 1)
VAR __StartWeek = WEEKNUM(__StartOfMonth)
VAR __CurrentWeek = WEEKNUM(__Date)
RETURN
IF( (__CurrentWeek - __StartWeek) > 2,"P2", "P1")

Column 2 = FORMAT([Date],"mmm")

 

 

Please create a clustered column chart like below, you can split Month into Biweekly but Still Remain in Date Format:

vyadongfmsft_0-1661766197096.png

 

If I misunderstand your demands, please provide some data screenshots (remember to hide sensitive information) to help us better solve your problem.

 

Best regards,

Yadong Fang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

ninimoke
Helper I
Helper I

Thanks @Greg_Deckler , I am still new to Power BI, if you can help with the DAX that can achieve that. Thanks.

@ninimoke Well, I don't know your data so not sure how you segment your months. If all you have is a Date column then perhaps something along the lines of:

Column =
  VAR __Date = [Date]
  VAR __StartOfMonth = DATE(YEAR(__Date), MONTH(__Date), 1)
  VAR __StartWeek = WEEKNUM(__StartOfMonth)
  VAR __CurrentWeek = WEEKNUM(__Date)
RETURN
  IF( (__CurrentWeek - __StartWeek) > 2,"Period 2", "Period 1")

Otherwise, Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Super User
Super User

@ninimoke You should be able to create a column that flags the period and then just use that in your Legend. Should end up with 2 columns for each month.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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