Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Summarise data from a different table

Hi All

 

It must be Monday because my brain doesnt work!

 

So here is the problem.........

 

I want to sum a value from another table (table 1 below) to give me a total (in New Table) like this;

 

Table1

NameHours
Dave40
Ted40
Gary40
Gary30
Ted50

 

New Table

NameTotal Hours
Dave40
Ted90
Gary70

 

How?!?!?!  Its driving me mad.  

 

  • Anonymous not sure you are looking to create a new table in the model or use table visual,

     

    for table visual, just drop the name and total hours on value section and if total hours is a number column, it will sum, if not then just click the arrow next to total hours, change the aggregation to sum

     

    if you want to create a new table, use following DAX expression

     

    New Table = SUMMAARIZE ( Table, Table[Name), "Total Hours", SUM( Table[Total Hours] ) )

     

    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.

3 Replies

  • Anonymous not sure you are looking to create a new table in the model or use table visual,

     

    for table visual, just drop the name and total hours on value section and if total hours is a number column, it will sum, if not then just click the arrow next to total hours, change the aggregation to sum

     

    if you want to create a new table, use following DAX expression

     

    New Table = SUMMAARIZE ( Table, Table[Name), "Total Hours", SUM( Table[Total Hours] ) )

     

    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.

    • Anonymous's avatar
      Anonymous
      Not applicable

      ah thanks!  Yeah I've been a bit silly there havent I?  It must have been a Monday thing!!

       

      Thanks for your help!

  • v-eachen-msft's avatar
    v-eachen-msft
    Community Support

    Hi Anonymous ,

     

    You could use "Group By" feature to get total values in query editor.

    Here is the result.