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
Puja
Helper III
Helper III

Week number with in Quarter in column

 

Hello All,

How can I get the  Date format like this? TIA

 

Puja_1-1656276954553.png

 

 

1 ACCEPTED SOLUTION

Hi @Puja 

Thanks for reaching out to us.

>>   I need to show 13 weeks in th Visual for each quarter (ex: for Quarter 3 (April-June ))

You can try this,

(1) create a calendar table

calendar = CALENDAR(DATE(2022,1,1),DATE(2022,12,31))
create a week column, 
week = WEEKNUM('calendar'[Date])

(2) create the 2 measures,

week = MAXX(FILTER('calendar','calendar'[Date]=MIN('Table'[Date])),[week])
Measure = 
var _currentDate=DATE(2022,5,23)
var _currentWeek= MAXX(FILTER('calendar','calendar'[Date]=_currentDate),[week])
return IF([week]>_currentWeek-6 && [week]<_currentWeek+6,IF(([week]-_currentWeek)>0, "Week +"&([week]-_currentWeek),"Week "&([week]-_currentWeek)))

result

vxiaotang_0-1656482667705.png

Best Regards,

Community Support Team _Tang

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

View solution in original post

4 REPLIES 4
Puja
Helper III
Helper III

Thank you SO MUCH @kitgo2.

I need to get weeks by quarter .

 

  I need to show 13 weeks in th Visual for each quarter (ex: for Quarter 3 (April-June ))

Previous weeks with - and future weeks with + sign like the way in this screen shot. TIA

 

Puja_0-1656301213790.png

 

Hi @Puja 

Thanks for reaching out to us.

>>   I need to show 13 weeks in th Visual for each quarter (ex: for Quarter 3 (April-June ))

You can try this,

(1) create a calendar table

calendar = CALENDAR(DATE(2022,1,1),DATE(2022,12,31))
create a week column, 
week = WEEKNUM('calendar'[Date])

(2) create the 2 measures,

week = MAXX(FILTER('calendar','calendar'[Date]=MIN('Table'[Date])),[week])
Measure = 
var _currentDate=DATE(2022,5,23)
var _currentWeek= MAXX(FILTER('calendar','calendar'[Date]=_currentDate),[week])
return IF([week]>_currentWeek-6 && [week]<_currentWeek+6,IF(([week]-_currentWeek)>0, "Week +"&([week]-_currentWeek),"Week "&([week]-_currentWeek)))

result

vxiaotang_0-1656482667705.png

Best Regards,

Community Support Team _Tang

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

Thank you so much @v-xiaotang 

 This works perfoct with the static date 
var _currentDate=DATE(2022,5,23) , when i added Today(), it s not working . I want it to be dynamic .

If its current week then "Current", past weeks  - and future weeks with + symbol with in the quarter.

This is past screenshot example.

Puja_0-1657294274410.png

TIA

 

 

kitgo2
Advocate I
Advocate I

Week# = if ('Calendar'[Date] = TODAY(),"Current", if (year(Today()) = Year('Calendar'[Date]),"Week " & ( WEEKNUM('Calendar'[Date],2) - WEEKNUM(today(),2)) ,"Week " & ( WEEKNUM('Calendar'[Date],2) - (WEEKNUM(today(),2) + 52))))

 

Start of week = if(WEEKDAY('Calendar'[Date],2) = 1, 'Calendar'[Date]) -- filter visual to only select non blanks or filter out only mondays

 

Format = 'Calendar'[Week#] & " " & UNICHAR(10) &
FORMAT('Calendar'[Date],"dd-mmm") & UNICHAR(10) & "Monday - Sunday"

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.