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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
lisaburton
Frequent Visitor

dax for week number

I want to show the current week only on a matrix of plan vs adherence.

I can display all 52 weeks of the year but i am unsure of how to set up a Dax to only view the current week 

lisaburton_0-1661251423722.png

 

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

Hi @lisaburton ,

According to your description, here's my solution, create a measure.

Check =
IF ( MAX ( 'Table'[Week No] ) = WEEKNUM ( TODAY () ), 1, 0 )

Put the measure in the visual filter and select its value to 1.

vkalyjmsft_0-1661841980693.png

After apply filter, get the correct result.

vkalyjmsft_1-1661842041597.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

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

6 REPLIES 6
v-yanjiang-msft
Community Support
Community Support

Hi @lisaburton ,

According to your description, here's my solution, create a measure.

Check =
IF ( MAX ( 'Table'[Week No] ) = WEEKNUM ( TODAY () ), 1, 0 )

Put the measure in the visual filter and select its value to 1.

vkalyjmsft_0-1661841980693.png

After apply filter, get the correct result.

vkalyjmsft_1-1661842041597.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

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

 

ToddChitt
Super User
Super User

Can you use the Relative Date Slicer settings to get what you want?

Before that was available, I typically would build into my Date dimension table things like [Months Back] which would be calculated relative to today's date. So if today is in August 2022, then anything in July 2022 would be 1 Month Back, June would be 2, etc. Can you build something like that into your Date dimension for Weeks, then filter on Weeks Back = 0?




Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





Hi Thank you! 

I have tried the slicer but it alters every visual on the report page and I just need it on the 1 matrix 

Do you have the dax forulas for the 2nd option you mentioned? 

>>I have tried the slicer but it alters every visual on the report page and I just need it on the 1 matrix >>

Try setting the "Edit Interactions" under the Format menu (far left button) that will allow you to make it that the Slicer does, or does not, affect other visuals on the page.

>>Do you have the dax forulas for the 2nd option you mentioned? << I'm more of a SQL guy than DAX, and well, "to a hammer, the whole world is a nail". I used to build Date Dimensions, with all associated properties in T-SQL Views.

Try this:

Weeks Back = DATEDIFF NOW(),  [Some Date Column],  WEEK)



Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





Thank you!

I have a 'last week' dax and i can amend this to show the 'next week' date but how do i amend it to show this week date? 

Last Week =
IF (
YEAR ( [Week ] ) = YEAR ( TODAY () )
&& WEEKNUM ( [Week ],2 ) = WEEKNUM ( TODAY () -7 ),
"Yes",
"No"
)

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors