Search code examples
powerbidaxpowerbi-desktoppowerbi-datasourcepowerbi-custom-visuals

DAX with IF and OR


I create a DAX to answer the following question.

High priority is any of the following:

  • Contracted priority is not L4, or
  • MHF/HACCP > 399, or
  • Work Priority < 3

High Priority = IF('WO Feedback'[Contracted Priority] > "L4" || 'WO Feedback'[HACCP/MHF] > 399 || 'WO Feedback'[Work Priority] < 3, "YES", "NO")

The following error message popped up "DAX comparison operations do not support comparing values of type Text with values of type Integer. Consider using the VALUE or FORMAT function to convert one of the values".

Can you please advise the correct Dax and errors in my DAX?


Solution

  • Error message give you a direct solution; Use VALUE function

    High Priority = IF('WO Feedback'[Contracted Priority] > "L4" || VALUE('WO Feedback'[HACCP/MHF]) > 399 || VALUE('WO Feedback'[Work Priority]) < 3, "YES", "NO")