Forum Discussion

wkelly1002's avatar
wkelly1002
Frequent Visitor
8 years ago
Solved

Need help with DAX equation for an IF OR statement

I am trying to to create a DAX equation for a calculated column that will take the difference of 2 dates, and then display either "<5" or ">5" depeending on how many days is between the 2 dates.

 

IF there are 4 or less days in between the column "Reference Date" and the column "RCA Investigation Completed AT", display "<5"

 

IF there are 5 or more days in between the column "Reference Date" and the column "RCA Investigation Completed AT", display "<5"

The first part of my code puts a blank if it recognizes a blank in the "RCA Investigation Completed AT" column

 

FCC Final Finlly Theshold Category = 
IF('Active RCA Audit'[RCA Investigation Completed AT]=BLANK(),
    BLANK(),
    IF(OR(DATEDIFF('Active RCA Audit'[Reference Date],'Active RCA Audit'[RCA Investigation Completed AT],DAY)<=4,"<5",
        DATEDIFF('Active RCA Audit'[Reference Date],'Active RCA Audit'[RCA Investigation Completed AT],DAY)>=5,">5"),
        BLANK())))

 

 

  • Hi,

     

    Does this work?

     

    FCC Final Finlly Theshold Category = IF(ISBLANK('Active RCA Audit'[RCA Investigation Completed AT]),BLANK(),IF('Active RCA Audit'[RCA Investigation Completed AT]-'Active RCA Audit'[Reference Date]<=4,"<5",">5"))

1 Reply

  • Hi,

     

    Does this work?

     

    FCC Final Finlly Theshold Category = IF(ISBLANK('Active RCA Audit'[RCA Investigation Completed AT]),BLANK(),IF('Active RCA Audit'[RCA Investigation Completed AT]-'Active RCA Audit'[Reference Date]<=4,"<5",">5"))