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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Create Column with modification of one condition

Hi,

 

I have a dataset with the following

 

TIme Frame

Latest 4 wks - 02/06/2021

Latest 13 wks - 02/06/2021

Latest 26 wks - 02/06/2021

Latest 52 wks - 02/06/2021

 

I am using a create column function to give me the "Time Frame", either 4,13,26 or 52 and it is working good.

 

However because my formula to capture this = Trim(Left(Time Frame,12) gives me the correct results of:

 

Latest 13wks

Latest 26wks

Latest 4 wks

Latest 52wks

 

But now I want to use the above as a slicer and I want them to appear as the following which is also in sorted order by time frame:

 

Latest 04 wks

Latest 13wks

Latest 26wks

Latest 52wks

 

How can I accomplish this?

 

 

 

 

 

1 ACCEPTED SOLUTION
Tahreem24
Super User
Super User

@Anonymous ,

Create new column as WeekNum like below:

WeekNum = WEEKNUM(Table[YourDateColumn])
Then go to Data view then select TimeFrame Column then click on "Sort by Column" then choose the above WeekNum column. (See the attached screen shot)

Capture.PNG

 

Final Output:

Capture.PNG

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

View solution in original post

2 REPLIES 2
Tahreem24
Super User
Super User

@Anonymous ,

Create new column as WeekNum like below:

WeekNum = WEEKNUM(Table[YourDateColumn])
Then go to Data view then select TimeFrame Column then click on "Sort by Column" then choose the above WeekNum column. (See the attached screen shot)

Capture.PNG

 

Final Output:

Capture.PNG

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
amitchandak
Super User
Super User

@Anonymous , I am assuming these are values in the column, Create a column that has sort order for these columns.

Refer my video, I have explained that in details:https://www.youtube.com/watch?v=KK1zu4MBb-c

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors