Forum Discussion
Issue with Measure and Text Columns
Hello good morning, I'm learning to use Dax on my own, and I don't know what I'm doing wrong, I took a table of winning Eurovision songs and I wanted to check two columns of text type winning country with host country, and I get an error. The measurement I wanted to use is this:
Thank you in advance
Hello Syndicate_Admin
Here You are creating measure that's why it's require aggregate functions like min and max
You should use calculated column
Create a calculated column and write the same DAX and it'll work.
8 Replies
- AnkitKukrejaSuper User
Hi! Syndicate_Admin
Please make sure your both the comparing columns are of same data type. Mine were text and it works for me.
- Syndicate_AdminAdministrator
Hello, thank you very much for your quick response, checking and they are the same type of data, here I leave you so you can see and thank you very much in advance:
- Syndicate_AdminAdministrator
Reviewing the problem with the columns I am seeing that it does not pick them correctly:
- BIswajit_DasImpactful Individual
Hello AnkitKukreja
Can you provide data in table format with your required result data
If you are simply compairing two columns you can usecoincide =IF(UPPER('Table'[PaisAnfitrion]) IN { UPPER('Table'[PaisGanador]) } , 1, 0)
to create calculated column- Syndicate_AdminAdministrator
I don't know how to pass the table, but the problem is that it doesn't let me use the column unless I use the SUM command, with other commands it gives me a problem, I have checked that the Eurovision table is correctly written, and that the column does not have any type of accent or strange character, I have checked that the data is text type.
The summary is that I get an error when using the table, which :
"A single value cannot be determined for the 'Winning country' column in the Eurovision table'. This can happen when a measurement formula references a column that contains many values without specifying an aggregation, such as min, max,..., to get a single result."
- BIswajit_DasImpactful Individual
Hello Syndicate_Admin
Here You are creating measure that's why it's require aggregate functions like min and max
You should use calculated column
Create a calculated column and write the same DAX and it'll work.- Syndicate_AdminAdministrator
Okay, thank you very much now I understand
- AnonymousNot applicable
Thank you AnkitKukreja and BIswajit_Das for your timely reply.
If your problem has been solved, please accept it as a solution!
Regards,
Nono Chen