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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.