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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

problem DAX checking day of week and field values

A simple DAX formula is giving me a headache, I have a Table, showing various project related data, one field being the date the project was last updated, formatted as a date field, dd/mm/yyyy.

This was a new field, so the initial check was to see whether it was blank or had a date in, all worked fine and it set the "WeekCheck" field  to 1 if blank/more than 6 days old or 0 if the date was present and was for this week. This WeekCheck is used to drive conditional formatting of the report.

All good so far . . . however then the report needed presenting to senior management, who didn't need to see the format shading for projects not updated, so I added a Weekday check to the formula and that's where it all went wrong. We only need the code set if it is a Tuesday, when we review with the Project Managers, at all other times it shouldn't be set and the conditional formatting doesn't kick in.  Original code and then new, failing code, in that it sets 1 for everything

WeekCheck = if(
            ISBLANK(Projects[WeekCommencing])||
            Projects[WeekCommencing]<(TODAY()-6),
            1,
            0)
WeekCheck = IF(
    AND(
        WEEKDAY(TODAY()=3),
        OR(
            ISBLANK(Projects[WeekCommencing]),
                    Projects[WeekCommencing]<(TODAY()-6))),
    1,
    0)

I've tried laying it out in Excel and get it working perfectl, but when I try in DAX it says NO !

 

Would be so grateful if this can be resolved

Regards

Fred

 

 

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous , the Second formula has an issue on the position =3

WeekCheck = IF(
    AND(
        WEEKDAY(TODAY())=3,
        OR(
            ISBLANK(Projects[WeekCommencing]),
                    Projects[WeekCommencing]<(TODAY()-6))),
    1,
    0) 

 

See if this can help

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

Anonymous
Not applicable

Hi @amitchandak once again you save the day, so obvious when you point it out.  Thanks for the solution 🙂

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , the Second formula has an issue on the position =3

WeekCheck = IF(
    AND(
        WEEKDAY(TODAY())=3,
        OR(
            ISBLANK(Projects[WeekCommencing]),
                    Projects[WeekCommencing]<(TODAY()-6))),
    1,
    0) 

 

See if this can help

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hello @amitchandak

Not sure why this has been moved to the Spannish language site, I accepted as solution on original posting and am unable to accept it here.

Anonymous
Not applicable

Hi @amitchandak once again you save the day, so obvious when you point it out.  Thanks for the solution 🙂

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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