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
jay_patel
Helper IV
Helper IV

Want week Number from 1 for those months also where week starting from saturday or sunday.

Hi experts

 

Here is my graph as you can see in attached picture and selected month year is 'MAY-2021' where week 1 started from saturday so they dont have sales in week 1, however I want to consider from week 1 only. In the second screenshot you can see I am extracting WEEK NO from Transaction date, So is there any way where i can consider week 2 as week 1 and so on for the months that dont have sales in 1st week.

 

Thanks & RegardsMIS 1.PNGweek of the month.png

1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
Community Support

Hi @jay_patel ,

 

Create a column with dax expression as below:

Adjusted week no = 
var _firstday=STARTOFMONTH('Table'[Date])
var _weekday=WEEKDAY(_firstday,2)
Return
IF(_weekday=6||_weekday=7,
  IF('Table'[Week month]=1,BLANK(),"Week"&('Table'[Week month]-1)),
   "Week"&'Table'[Week month])

Then you would see:(Remember to modify the data type of "Week month" to whole number)

v-kelly-msft_0-1623655016105.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

 

View solution in original post

1 REPLY 1
v-kelly-msft
Community Support
Community Support

Hi @jay_patel ,

 

Create a column with dax expression as below:

Adjusted week no = 
var _firstday=STARTOFMONTH('Table'[Date])
var _weekday=WEEKDAY(_firstday,2)
Return
IF(_weekday=6||_weekday=7,
  IF('Table'[Week month]=1,BLANK(),"Week"&('Table'[Week month]-1)),
   "Week"&'Table'[Week month])

Then you would see:(Remember to modify the data type of "Week month" to whole number)

v-kelly-msft_0-1623655016105.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

 

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.