Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello all,
I'm getting in trouble with a simple IF function. I'm new to powerbi and I was not able to find a answer in previous questions in the forum. My fuction is:
Status = if(tGetTasks[Dashboard Grid]>1, if(tGetTasks[Actual End]>tGetTasks[DueDate]+1, "Completed - Late", "Completed - On Time"))
The point is that the IF function does not recognize any of my collumns from the table "tGetTasks". It is recognizing only calculated functions inside it.
What is weird is that I have copied this IF fuction from another powerbi file and it is working perfectly there. I have also checked and the column name is right in my table.
I really appreciate any support.
Thank you,
Tiago Cirilo
Solved! Go to Solution.
Hey @Anonymous ,
I assume that the reason for this unexpected behavior is just this:
You are creating a new measure. A measure can be considered as an aggregation of a numeric value from a filtered table. For this reason the reference of a column inside a table has to be wrapped into an aggregation function like SUM(...).
On the other hand the creation of a calculated column allows to reference a column without using an aggregation function as the formula is evaluated for each row of the table. A more technical phrase will be: the formula of a calculated column will be evaluated inside the Row Context.
I guess what happened is this, you copied the DAX code from a calculated column and by accident tried to use it inside a measure definition.
Another hint, the term "calculated functions" is not common in the world of DAX, please try to discover what it is called that you are referencing to avoid confusio 🙂
Hopefully this provides some additional insights.
Regards,
Tom
Hey @Anonymous ,
I assume that the reason for this unexpected behavior is just this:
You are creating a new measure. A measure can be considered as an aggregation of a numeric value from a filtered table. For this reason the reference of a column inside a table has to be wrapped into an aggregation function like SUM(...).
On the other hand the creation of a calculated column allows to reference a column without using an aggregation function as the formula is evaluated for each row of the table. A more technical phrase will be: the formula of a calculated column will be evaluated inside the Row Context.
I guess what happened is this, you copied the DAX code from a calculated column and by accident tried to use it inside a measure definition.
Another hint, the term "calculated functions" is not common in the world of DAX, please try to discover what it is called that you are referencing to avoid confusio 🙂
Hopefully this provides some additional insights.
Regards,
Tom
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |