Forum Discussion

Akshay_echo1995's avatar
Akshay_echo1995
Regular Visitor
2 years ago

Conditional Formatting not executting completely.

Hi Everyone,

 

We have 2 columns one with user name and on other we have the login date when they have last logged in, when we are trying to do conditional formatting to check whether they are login whithin time time or not.

We are trying to achive RAG (Red Amber Green ) status on column so that we can check who is not login within time.

If they are filling the timesheet within 7 days then it should be Green , withinn 14 days , Amber , rest should be in Red.

We are using below DAX to achive the same but its only executing the 1st condition not rest , Please help ,

 

DRV2 = IF(SELECTEDVALUE('DW Celoxis_TimeEntries'[data']][0]]['workItem_data_plannedStart]) - 7 , "Green",
IF(SELECTEDVALUE('DW Celoxis_TimeEntries'[data']][0]]['workItem_data_plannedStart]) -7 , "Amber" , "Red"
))

 

 
Thanks
Akshay 

5 Replies

  • PijushRoy's avatar
    PijushRoy
    Community Champion

    Hi Akshay_echo1995 

    Please try below DAX

     

    DRV2 =
    IF (
       ( SELECTEDVALUE ( 'DW Celoxis_TimeEntries'[data']][0]]['workItem_data_plannedStart] ) - Today()) <= 7,
        "Green",
        IF (
           ( SELECTEDVALUE ( 'DW Celoxis_TimeEntries'[data']][0]]['workItem_data_plannedStart] ) - Today())<= 14,
            "Amber",
            "Red"
        )
    )

     

     


    Let me know if that works for you


    If your requirement is solved, please mark THIS ANSWER as SOLUTION ✔️ and help other users find the solution quickly. Please hit the Thumbs Up 👍 button if this comment helps you.

    Thanks
    Pijush
    Linkedin

    • Akshay_echo1995's avatar
      Akshay_echo1995
      Regular Visitor

      Aleady tried this but only getting Green , its not getting executed for Amber and Red.

      • PijushRoy's avatar
        PijushRoy
        Community Champion

        Hi Akshay_echo1995 

        Hope this column in Date format 

        'DW Celoxis_TimeEntries'[data']][0]]['workItem_data_plannedStart]

        You are calculating measure and using the measure in Field value of the conditional formatting

        Please create a sample PBIX and share the google drive link


         


        Let me know if that works for you


        If your requirement is solved, please mark THIS ANSWER as SOLUTION ✔️ and help other users find the solution quickly. Please hit the Thumbs Up 👍 button if this comment helps you.

        Thanks
        Pijush
        Linkedin