Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 |
---|---|
77 | |
76 | |
44 | |
31 | |
26 |
User | Count |
---|---|
98 | |
89 | |
52 | |
48 | |
46 |