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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
U156531
Post Patron
Post Patron

DAX error in IF statement

Can someone instruct me how to get rid of this DAX error. A single value for column 'dmc_name' in table 'dmc' cannot be determined. This can happen when a measure formula refers to a column that contains many values .

 

Name = if ('dmc'[dmc_name] = "AURORA" , "b","a")
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @U156531 ,
Based on the description provided, it looks like you are encountering an issue where the IF statement in your DAX expression is expecting a single value for the 'dmc_name' column but is instead getting multiple values. This typically happens in a row context where the column reference is ambiguous.
You can use the selectedvalue function in your original formulas to specify the value you choose to match the logic of the judgment.

Here is my test data:

vheqmsft_0-1705904384657.png

Crate a measure

 

Name = IF(SELECTEDVALUE(dmc[dmc_name]) = "AURORA","b","a")

 

FInal output

vheqmsft_1-1705904433459.png

 

Best regards

Albert He

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
 

 

 

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @U156531 ,
Based on the description provided, it looks like you are encountering an issue where the IF statement in your DAX expression is expecting a single value for the 'dmc_name' column but is instead getting multiple values. This typically happens in a row context where the column reference is ambiguous.
You can use the selectedvalue function in your original formulas to specify the value you choose to match the logic of the judgment.

Here is my test data:

vheqmsft_0-1705904384657.png

Crate a measure

 

Name = IF(SELECTEDVALUE(dmc[dmc_name]) = "AURORA","b","a")

 

FInal output

vheqmsft_1-1705904433459.png

 

Best regards

Albert He

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
 

 

 

Bibiano_Geraldo
Super User
Super User

Try this:

Name = 

VAR name = 'dmc'[dmc_name]

RETURN

IF(name = "AURORA" , "b","a")

bhanu_gautam
Super User
Super User

Yes you can use filter function in this way

 

Name =
IF(
COUNTROWS(FILTER('dmc', 'dmc'[dmc_name] = "AURORA")) > 0,
"b",
"a"
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






bhanu_gautam
Super User
Super User

 , Try this one 

Name = IF(MAX('dmc'[dmc_name]) = "AURORA", "b", "a")

 

And accept as solution if it helps

@U156531




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






No, The Max function only looks at the greatest dmc_name value in the table and I need to inspect every occurance of the dmc_name. Can I use some other function like Filter or Calculate or a grouping function inside the If statement or inplace of it? 

hello @U156531 ,

 

can you please provide the pbix file so i can take a look and try to help you with the solution ? 

if you cant ,  could you at least share screenshots about the sample data and the output desired  ? 

 

best regards

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors