Forum Discussion

HenryJS's avatar
HenryJS
Post Prodigy
6 years ago
Solved

Add Column: If statement

Hi all,

 

How can I add a column that returns "Yes" if the following statements are true:

  • CSCS is blank
  • OR CSCS is in the next 1 Month
  • OR Passport is blank
  • OR Passportin the next 1 Month
  • OR Reference 1 is "No"
  • OR Reference 2 is "No"

 

Please could someone advise the DAX code?

 

Thank you

 

  • Hi HenryJS 

    try

    Column = IF(
    ISBLANK([CSCC]) ||
    DATEDIFF(TODAY(), [CSCC], MONTH) <= 1 ||
    ISBLANK([Passport]) ||
    DATEDIFF(TODAY(), [Passport], MONTH) <= 1 ||
    [Reference1] = "No" || 
    [Reference2] = "No"
    ,
    "Yes",
    "Other"
    )

2 Replies

  • az38's avatar
    az38
    Community Champion

    Hi HenryJS 

    try

    Column = IF(
    ISBLANK([CSCC]) ||
    DATEDIFF(TODAY(), [CSCC], MONTH) <= 1 ||
    ISBLANK([Passport]) ||
    DATEDIFF(TODAY(), [Passport], MONTH) <= 1 ||
    [Reference1] = "No" || 
    [Reference2] = "No"
    ,
    "Yes",
    "Other"
    )
    • HenryJS's avatar
      HenryJS
      Post Prodigy

      az38 yes!! That's perfect. Thank you - can always rely you will give the exact answer as required!!

       

      Hope you are well.

       

      Henry