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
Anonymous
Not applicable

HOW TO SHOW WEEKNUMBER PER PERIOD ?

1 PERIOD CONTAION 4 WEEKS  I NEED WEEKNUMBER TO RESET EACH PERIOD 

THANKS

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

Hi @Anonymous ,

 

According to your description, you want to group by period and sort by week number.

Here's my solution.

Sample data.

vstephenmsft_0-1639552229237.png

 

Create a calculated column.

WeekNum = RANKX(FILTER('Table',[Period]=EARLIER('Table'[Period])),WEEKNUM([Date],2),,ASC,Dense)

vstephenmsft_1-1639552251716.png

 

Best Regards,

Stephen Tao

 

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

5 REPLIES 5
v-stephen-msft
Community Support
Community Support

Hi @Anonymous ,

 

According to your description, you want to group by period and sort by week number.

Here's my solution.

Sample data.

vstephenmsft_0-1639552229237.png

 

Create a calculated column.

WeekNum = RANKX(FILTER('Table',[Period]=EARLIER('Table'[Period])),WEEKNUM([Date],2),,ASC,Dense)

vstephenmsft_1-1639552251716.png

 

Best Regards,

Stephen Tao

 

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

This very helpful but would you be able to help with for some the periods the weeknum starts from 2 instead of 1

 Hi,

 

Please try using below Dax

WeekNum = WEEKNUM('Table'[Period])

WeekNum.JPG

 

Anonymous
Not applicable

it works but i need week num to reset each period.

How about MOD ( WEEKNUM, 4 )?

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.

Top Solution Authors