Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Need Table equivalent of SELECT name, sum(amount) from Table group by Name

I have a table that looks like this and I need to make another table that sums up the amounts for each person.

 

name amount

bob 10

joe 5

mike 7

bob 5

mike 2

 

I need the equivalent of this SQL code:

SELECT name, sum(amount) from Table group by name;

which would give this result:

 

name amount

bob 15

joe 5

mike 9

 

Thanks in advanced.

 

 

 

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

Hello @Anonymous 

Give this a try.

Table2 = 
ADDCOLUMNS (
    SUMMARIZE('Table','Table'[name]),
    "Amount",CALCULATE(SUM('Table'[amount]))
)

addcolumns.jpg

View solution in original post

2 REPLIES 2
jdbuchanan71
Super User
Super User

Hello @Anonymous 

Give this a try.

Table2 = 
ADDCOLUMNS (
    SUMMARIZE('Table','Table'[name]),
    "Amount",CALCULATE(SUM('Table'[amount]))
)

addcolumns.jpg

Anonymous
Not applicable

Thank you!! @jdbuchanan71 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.