Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

IF condition returns DAX error

  Below is a sample of the IF statements returning an error. The error is below. Also, I have tried using a Switch stmt and still get the error. Can anyone tell me what is wrong? When I use MAX it w...
  • Nathaniel_C's avatar
    Nathaniel_C
    6 years ago

    Anonymous ,

     

    Yes MAX() is correct. You are asking the engine to make a decision based on your field value, yes? How does DAX "know" which row in that field is the one to use? Row 1? Row 2? etc. 

     

    Until you place it on a something that filters all the values down to one, you are trying to give it multiple values.  However when you place it on a matrix, there is only one value, the value from that row.

     

    Let me recommend Supercharge Power BI by MattAllington 


    Let me know if you have any questions.

    If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
    Nathaniel