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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Justas4478
Post Prodigy
Post Prodigy

Highlight current week using conditional column

Hi, I have chart that shows holiday hours booked by weeks.

Justas4478_0-1737537563448.png

I want to highlight current week using the coditional formatting option.
But the only way I see is by writing measure that checks if it is current week

I had something similar done for check if anyone is on holiday today, but I cant work out how to change it to check for this week instead of today.

IF(MAX('Holiday Data'[Start Date])=TODAY(),0,1)
1 ACCEPTED SOLUTION
mark_endicott
Super User
Super User

@Justas4478 - Try this:

 

 

 

VAR _StartOfWeek = TODAY() - WEEKDAY( TODAY(), 2 ) + 1 

RETURN
IF(MAX('Table'[Date Column])= _StartOfWeek,1,0)

 

 

It will proivde a 1 if your date column matches the _StartOfWeek variable.

 

 

If this helps you, please accept as the solution so others with the same issue can find the answer!

View solution in original post

4 REPLIES 4
mark_endicott
Super User
Super User

@Justas4478 - Try this:

 

 

 

VAR _StartOfWeek = TODAY() - WEEKDAY( TODAY(), 2 ) + 1 

RETURN
IF(MAX('Table'[Date Column])= _StartOfWeek,1,0)

 

 

It will proivde a 1 if your date column matches the _StartOfWeek variable.

 

 

If this helps you, please accept as the solution so others with the same issue can find the answer!

I tried it and it doesnt seam to work when I put it in conditional rule.

Justas4478_0-1737540343570.png
If I change it to 1 instead of 0 it the colors all dates

Justas4478_1-1737540385113.png

 

@Justas4478 - The DAX is correct, but you cannot apply it to the Values of the axis lables, I suggest you apply it to the Column colour instead. This will highlight the current week in a better way:

 

mark_endicott_0-1737541115580.png

 

 

Yea that worked, thanks

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.