Forum Discussion
IF condition returns DAX error
- 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
Thanks for your help. Let me be more clear on my request. I am looking for another way to write this in DAX where I do not have to use the MAX function or is MAX correct for this? This is a common query.
If my field value = XXXX then do this formula
if my field value = YYYY then do this formula
It does not seem right having to use the MAX function but maybe it is???
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