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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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

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

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
September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Top Solution Authors