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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

A Simple Calculated Column With IF Statement

I'm having a really hard time with a seemingly simple calculated column.  I have a table representing route data with rows/values indicating picks, drops, lunches, leave base, return base, etc.  There are multiple routes with multiple activities on each route.  I just need a column evaluating every row and indicating whether the activity is a pick, so I tried the following:

 

ISPick = IF(
    'Manifest'[Activity] = "Pick", 1,0
    )

I'm expecting a 1 in the column if the row is actually a pick (vs any other type of activity) otherwise a 0.

 

 

I'm getting an error "A single value for column 'Activity' in table 'Manifest' cannot be determined.  This can happen when a measure formula refers to a column refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result."

 

I'm so confused. It seemed like the logic was so basic to get this done.  What did I miss??

5 REPLIES 5
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

As Ashish_Mathur and Nick_M suggested, you should make sure you created a calcuated column rather than a measure with above formula. If you want to new a measure to evaluate every row and indicating whether the activity is a pick, you need this formula:

ISPick = IF( SELECTEDVALUE('Manifest'[Activity]) = "Pick", 1,0 )

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

All,

 

I'm definitely using a calculated column and NOT a measure so still not sure why this is happening.

 

Since I can't get beyond this, I think I'll have to approach things differently and just create the field directly from the datasource rather than create it in the power bi model.

 

Thanks

Anonymous
Not applicable

if you can upload a sample I can take a look.  Should be relatively straight-forward.

Ashish_Mathur
Super User
Super User

Hi,

 

There is no mistake in your formula.  I think you are writing that as a measure.  It should be written as a calculated column formula instead.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Sounds like you are adding a measure and not a calculated column.  They look the same, but act very differently:

Calc Column Location.png

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.