Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

IF function does not recognize columns

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

 

 

 

 

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

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



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

1 REPLY 1
TomMartens
Super User
Super User

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



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

May 2025 Monthly Update

Fabric Community Update - May 2025

Find out what's new and trending in the Fabric community.