Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Dynamically create measure based table

I have a datamodel with 5 tables- each having 2 measures M1 & M2 All M1 measures for each of these tables relate to Tasks- so i want to call the row as "Tasks" All M2 measures for each of these t...
  • parry2k's avatar
    6 years ago

    Anonymous you can create a table using summarize function and then use UNION to append these tables together, something like dax expression given below

     

    Table6 = 
    UNION (
    SUMMARIZE ( Table1, Table1[Id], "Name", "Table1", "Tasks", [Task Measure], "Travelers", [Traveles Measure] ),
    SUMMARIZE ( Table2, Table2[Id], "Name", "Table2", "Tasks", [Task Measure], "Travelers", [Traveles Measure] ),
    SUMMARIZE ( Table3, Table3[Id], "Name", "Table3", "Tasks", [Task Measure], "Travelers", [Traveles Measure] )
    )
    

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos 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.

     

     

  • parry2k's avatar
    parry2k
    6 years ago

    Anonymous solution attached, the similar thing you can do in power query instead of Dax

     

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos 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.