Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
2 years ago
Solved

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

    • Syndicate_Admin's avatar
      Syndicate_Admin
      Administrator

      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_Admin's avatar
        Syndicate_Admin
        Administrator

        Reviewing the problem with the columns I am seeing that it does not pick them correctly:

  • BIswajit_Das's avatar
    BIswajit_Das
    Impactful Individual

    Hello AnkitKukreja 

    Can you provide data in table format with your required result data
    If you are simply compairing two columns you can use

    coincide =
    IF(UPPER('Table'[PaisAnfitrion]) IN { UPPER('Table'[PaisGanador]) } , 1, 0)
    to create calculated column
    • Syndicate_Admin's avatar
      Syndicate_Admin
      Administrator

      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_Das's avatar
    BIswajit_Das
    Impactful 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.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Syndicate_Admin 

     

    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