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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
pagarc1
Frequent Visitor

I'm getting an error A single value for column 'Department' in table 'DIA SALES DATA' cannot be dete

Order Type = if('DIA SALES DATA'[Department]="24HRTS","DTP Nonrevenue",IF('DIA SALES DATA'[Department]="Distributor","Distributor","DTP Revenue"))
 
error below
A single value for column 'Department' in table 'DIA SALES DATA' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.
5 REPLIES 5
az38
Community Champion
Community Champion

Hi @pagarc1 

as you use a measure the DAX cannot understand what exactly cell of Department column you want to use for comparing.

So try to use SELECTEDVALUE() if you are trying to compare value in each rows, like

Order Type = if(SELECTEDVALUE('DIA SALES DATA'[Department])="24HRTS","DTP Nonrevenue",IF(SELECTEDVALUE('DIA SALES DATA'[Department])="Distributor","Distributor","DTP Revenue"))

or better use SWITCH() statement

SWITCH(
SELECTEDVALUE('DIA SALES DATA'[Department]),
"24HRTS","DTP Nonrevenue",
"Distributor","Distributor",
"DTP Revenue"
)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

Hi @pagarc1 ,

 

In measure you can not refer column directly.

Your dax will work for calculated column not for measure.

 

Incase you want to do the calculation using measure add 'min'/'max'/Selectevalue before column name

 

Order Type = if(max('DIA SALES DATA'[Department])="24HRTS","DTP Nonrevenue",IF(max('DIA SALES DATA'[Department])="Distributor","Distributor","DTP Revenue"))

 

Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar

If I resolve your problem Mark it as a solution and give kudos.

Anonymous
Not applicable

You can add only columns as slicer.

 

Create calculated column as below

 

Order Type = if('DIA SALES DATA'[Department]="24HRTS","DTP Nonrevenue",IF('DIA SALES DATA'[Department]="Distributor","Distributor","DTP Revenue"))

 

Note:

Measures are used for aggrigation and dynamic calculations.

Measure can be used as visual level filters but measures can be used in slicers.

 

Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar

If I resolve your problem Mark it as a solution and give kudos.

pagarc1
Frequent Visitor

I want to do something like this. I want to add it on a slicer although the previous formula worked. I couldn't add the field into a slicer.

ordertype.png

Chthonian
Helper III
Helper III

Hi @pagarc1 ,

 

While I cannot definitively answer why you are getting this without seeing your Data Model, in my experience when you get this type of error it is generally down to the data model relationships and setup. 

 

A good resource on this:

DAX error messages in Power BI 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors