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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Maheshguptaz
Helper II
Helper II

Week Count DAX

I've created a DAX for segregating dates into the half-yearly categories i.e. "1st Jan - 30th Jun" & "1st July - 31st Dec". However, I'd need to make it more dynamic like the below format:

 

30/06/2021 falls on a Thursday and 01/07/2021 is on a Friday. When I use the weeks to show my data, the same week is calculated twice on the two "half-yearly categories"

 

YearPeriodWeek CountValue
20211st Jan - 30th Jun27950
20211st Jul - 31st Dec27840

 

The week Count should be adjusted based on the dates given in the table. Can anyone help me with this?

 

Thanks in advance!

2 REPLIES 2
AilleryO
Memorable Member
Memorable Member

Hi,

 

Can you show us the formula you are using ?

hi @AilleryO ,

 

I'm using WEEKNUM() DAX in my formula. this is giving me the week count, however, if the last date of the month is coming in between the week then that week is calculated twice.

 

For the "half-yearly" category, I'm using the IF statement and Month no. to get the results

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.