Forum Discussion

ajitsahoo8338's avatar
ajitsahoo8338
Helper III
1 year ago

Need help with this logic

Hello Everyone, I am trying to create logic but failed to do. 
I need to create a Status Column. In which there should be rows/options i.e "On-Time", "Late", "Released"
"On-Time"= 

NOT(ISBLANK(Project_v2_w_LW_PPC[Release Date])) &&
    [Release Date] <= [Baseline_EndDate], "On-Time"
"Late"=
NOT(ISBLANK(Project_v2_w_LW_PPC[Release Date])) &&
    [Release Date] > [Baseline_EndDate] ||
    ISBLANK(Project_v2_w_LW_PPC[Release Date]) && [Baseline_EndDate] < TODAY(), "Late"
"Released"= 
NOT(ISBLANK(Project_v2_w_LW_PPC[Release Date])) &&
    [Release Date] <= [Baseline_EndDate || 
NOT(ISBLANK(Project_v2_w_LW_PPC[Release Date])) &&
    [Release Date] > [Baseline_EndDate]

(Basically, if any row has a Release Date Then It will be considered as Released)

 

The issue is with the Released logic because of overlapping conditions with On-Time and Late. How to write this codition correctly?

Thank You,
Ajit

19 Replies

  • Hi,

    Try the following DAX:

    If this answer help you, please make it as solution.

    Status =
    IF(
    NOT(ISBLANK(Project_v2_w_LW_PPC[Release Date])) &&
    Project_v2_w_LW_PPC[Release Date] <= Project_v2_w_LW_PPC[Baseline_EndDate],
    "On-Time",
    IF(
    NOT(ISBLANK(Project_v2_w_LW_PPC[Release Date])) &&
    Project_v2_w_LW_PPC[Release Date] > Project_v2_w_LW_PPC[Baseline_EndDate],
    "Late",
    IF(
    ISBLANK(Project_v2_w_LW_PPC[Release Date]) &&
    Project_v2_w_LW_PPC[Baseline_EndDate] < TODAY(),
    "Late",
    IF(
    NOT(ISBLANK(Project_v2_w_LW_PPC[Release Date])),
    "Released",
    BLANK()
    )
    )
    )
    )

    • Bibiano_Geraldo's avatar
      Bibiano_Geraldo
      Super User

      Could you please share a sample of your table? Please dont share sensitive data.

      Note:
      The released status will only appear if all other status are not satisfied.

      • ajitsahoo8338's avatar
        ajitsahoo8338
        Helper III

        Hello Bibiano_Geraldo and Uzi2019 My data looks like this. I want to create a visual table like this and add a status slicer. From that slicer, If I select On-Time then it should show On-Time rows and For Late selection it should show Late and For Released Selection, it should show those rows which have a release date.

         

  • Uzi2019's avatar
    Uzi2019
    Community Champion

    HI ajitsahoo8338 

     

    Can you share the sample data with expected output??

     

    It would be better working with data instead of just a logic.

     

    you can share the simple excel file screenshot for better understanding.

     

     

    • ajitsahoo8338's avatar
      ajitsahoo8338
      Helper III
      Project NumberActivity NumberTask NameResourceBaseline EndDateRelease Date
      2263000Long Lead ReleaseMECHANICAL8/16/2024 0:008/16/2024 0:00
      2273000Long Lead ReleaseMECHANICAL8/16/2024 0:008/16/2024 0:00
      1003000Manuals CompleteTECH6/18/2024 0:006/18/2024 0:00
      2273001GA Tasks/Initial BOMMECHANICAL9/13/2024 0:009/20/2024 0:00
      2253002GA Initial BOM ReleaseMECHANICAL7/29/2024 0:008/16/2024 0:00
      2263002 BOM ReleaseMECHANICAL9/13/2024 0:00 
      2203002Initial BOMMECHANICAL2/29/2024 0:003/29/2024 0:00
      723002l Comp Long LeadMECHANICAL5/31/2024 0:005/10/2024 0:00
      1313002Paint SchemeMECHANICAL6/21/2024 0:005/2/2024 0:00
      1313003Stop KitELECTRICAL5/31/2024 0:005/31/2024 0:00
      2253003MA GroupMECHANICAL9/17/2024 0:00 
      1323004Power RevisionELECTRICAL7/29/2024 0:007/30/2024 0:00

      My data looks like this. I want to create a visual table like this and add a status slicer. From that slicer, If I select On-Time then it should show On-Time rows and For Late selection it should show Late and For Released Selection, it should show those rows which have a release date

    • ajitsahoo8338's avatar
      ajitsahoo8338
      Helper III

      My data looks like this. I want to create a visual table like this and add a status slicer. From that slicer, If I select On-Time then it should show On-Time rows and For Late selection it should show Late and For Released Selection, it should show those rows which have a release date

       

    • ajitsahoo8338's avatar
      ajitsahoo8338
      Helper III

      Hello Uzi2019 

      My data looks like this. I want to create a visual table like this and add a status slicer. From that slicer, If I select On-Time then it should show On-Time rows and For Late selection it should show Late and For Released Selection, it should show those rows which have a release date.

       

      • Uzi2019's avatar
        Uzi2019
        Community Champion

        Hi ajitsahoo8338 

         

        Can you add one more staus column of Late/Release/On time. next to your table.???

        so that will create logic accordingly..

         

  • Hello Bibiano_Geraldo and Uzi2019  

    My data looks like this. I want to create a visual table like this and add a status slicer. From that slicer, If I select On-Time then it should show On-Time rows and For Late selection it should show Late and For Released Selection, it should show those rows which have a release date

     

  • ajitsahoo8338 You can try:

    Status = 
    SWITCH(
    TRUE(),
    NOT(ISBLANK(Project_v2_w_LW_PPC[Release Date])), "Released",
    NOT(ISBLANK(Project_v2_w_LW_PPC[Release Date])) && Project_v2_w_LW_PPC[Release Date] <= Project_v2_w_LW_PPC[Baseline_EndDate], "On-Time",
    (
    ISBLANK(Project_v2_w_LW_PPC[Release Date]) && Project_v2_w_LW_PPC[Baseline_EndDate] < TODAY()
    ) ||
    (
    NOT(ISBLANK(Project_v2_w_LW_PPC[Release Date])) && Project_v2_w_LW_PPC[Release Date] > Project_v2_w_LW_PPC[Baseline_EndDate]
    ), "Late",

    BLANK()
    )

    This structure ensures each row fits into exactly one category without overlap.

     

    💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
    Cheers,
    Kedar
    Connect on LinkedIn