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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

GROUPBY DAX to return a table with a sum of column that group by 2 other columns from another table

Hello wonderful community, I will try my best to be brief in this request.

 

For simplicity, I have a table below (the table name is WorkCentre220) that I have filtered Week Number = 38 and Year = 2022. The total sum of Required Hours under these filters is 98.698 (98.70 round off)

 

knafzal01_0-1661811457473.png

 

Challenge:

I want to return a new table using GROUPBY function that group [Week Number] and [Year] into a single row and sum the total value of column [Required Hours] into One Row.

 

I have worked out the DAX formula to return the table but can't quite figure out how to finish this:

 

Required_Hours_By_Week_And_Year = GROUPBYWorkCentre220WorkCentre220[5. Week Number]WorkCentre220[6. Year]"Total Required Hours by Week and Year", )

 

Expected Results:

 

Week NumberYearTotal Required Hours by Week and Year
38202298.70
392022264.90
40202294.90

 

I'd really appreciate if someone could help me please.

Thanks everyone and have a wonderful day!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi wonderful community, I have figured it out!!

 

Use SUMMARIZE instead of GROUPBY:

 

NewTable = SUMMARIZE(WorkCentre220,WorkCentre220[5. Week Number],WorkCentre220[6. Year],"Total",SUM(WorkCentre220[3. Required Hours]))

 

Results:

 

knafzal01_0-1661813704436.png

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi wonderful community, I have figured it out!!

 

Use SUMMARIZE instead of GROUPBY:

 

NewTable = SUMMARIZE(WorkCentre220,WorkCentre220[5. Week Number],WorkCentre220[6. Year],"Total",SUM(WorkCentre220[3. Required Hours]))

 

Results:

 

knafzal01_0-1661813704436.png

 

Hi @Anonymous ,

 

I am so glad to hear that your problem has been solved . Please consider Accept it as the solution to help the other members find it more quickly.

 

Best regards,

Yadong Fang

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.