Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

DATATABLE DAX giving error with multiple values

Hi,

 

I am trying to create a datatable with DAX using the function below:

 

_Test Param = DATATABLE("TestParam",STRING,{{"Test"},{"Test2"}})

 

PowerBI gives me an error indicating a table of multiple values was supplied where a single value was expected.

 

If I remove "Test2", it seems to work ok.

 

_Test Param = DATATABLE("TestParam",STRING,{{"Test"}})

 

How do I create a datatable with multiple values?

 

Thanks,

Kevin

4 Replies

  • Anonymous you are creating a table, you will go to modelling -> new table

     

    you cannot add table as a column

     

     

    Follow us on LinkedIn

     

    Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

     

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Ok thanks. That resolves my issue.

  • Anonymous not sure why you are getting error, it works for me:

     

     

    Follow us on LinkedIn

     

    Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

     

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Are you adding that as a new column?

       

      This is what I am doing. I am adding as new column and then entering the DAX function.

       

       

      Kevin