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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Date column Convert new column Week basics

I am trying to Create a  new column called week based on below logic

  1. If day part of lead_date <=7 -> Wk1
  2. If day part of lead_date  between 8 to 14 -> Wk2
  3. If day part of lead_date between 15 to 21 -> Wk3
  4. If day part of lead_date>21 -> Wk4

Sample Data:

 

trail_id                lead_date

626238              01-08-2021

626231              02-08-2021

626232              03-08-2021

646067              04-08-2021

644770              05-08-2021

--

--

643468              31-08-2021

 

 

My Measure :

WEEK = "Wk"& 1 + WEEKNUM ('Sheet1'[lead_date] ) -WEEKNUM( STARTOFMONTH ('Sheet1'[lead_date]))
 

looking for support .. thanks in advance

1 ACCEPTED SOLUTION
technolog
Super User
Super User

Hi!

You can try create calc column

SWITHC(TRUE(),

  DAY([lead_date]) <= 7, "Week 1",

  DAY([lead_date]) <= 14, "Week 2",

  DAY([lead_date]) <= 21, "Week 3",

  "Week 4"

)

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@technolog  thank you  its worked 

technolog
Super User
Super User

Hi!

You can try create calc column

SWITHC(TRUE(),

  DAY([lead_date]) <= 7, "Week 1",

  DAY([lead_date]) <= 14, "Week 2",

  DAY([lead_date]) <= 21, "Week 3",

  "Week 4"

)

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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