Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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
User | Count |
---|---|
85 | |
79 | |
64 | |
52 | |
46 |
User | Count |
---|---|
101 | |
43 | |
41 | |
39 | |
36 |