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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
sprakash1192
Helper II
Helper II

Grouped Sum

I have a summarized table like this:

YearProdFacNameDepartment NameWeekTotal_WCM_EUs
2020TylerWCM29563892.44
2020TylerWCM30589533.76

 

I would like to create a new column that has a total sum grouped by the rows like this :

YearProdFacNameDepartment NameWeekTotal_WCM_EUsTotal
2020TylerWCM29563892.441153426.2
2020TylerWCM30589533.761153426.2

 

How can I do this without create a new summarized table?

1 ACCEPTED SOLUTION

Hi  @sprakash1192 ,

 

Or you can use "earlier" function:

Total = SUMX(FILTER('Table','Table'[Key]=EARLIER('Table'[Key])),'Table'[Total_WCM_EUs])

And you will see:

Annotation 2020-08-20 095342.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

View solution in original post

6 REPLIES 6
AllisonKennedy
Community Champion
Community Champion

@sprakash1192
Hopefully one of the suggested formulas has helped you, but I'm just curios why you need the summarized table and have chosen to do this as a calculated table. Depending on the ultimate end goal, this could be done using MEASURES and matrix/table visual instead. If you're looking for some data model efficiencies, let us know your ultimate goal.

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

mahoneypat
Microsoft Employee
Microsoft Employee

You can add a calculated column to your calculated table with this expression.

Total =
CALCULATE (
SUM ( Table[Total_WCM_EUs] ),
ALLEXCEPT ( Table, Table[ProdFacName], Table[Year], Table[Department] )
)

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


parry2k
Super User
Super User

@sprakash1192 add a new measure like this:

 

Total = CALCUATE ( SUM ( Table[TOTAL_WCM} ), ALL() )

 

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.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

But it takes away all groups. I should have made my question clearer, I want to have a grouped sum by the Key in my table, like this :

YearProdFacNameDepartment NameWeekKeyTotal_WCM_EUsTotal
2020TylerWCM2929-30563892.41153426
2020TylerWCM3029-30589533.81153426
2020TylerWCM3131-324100009410000
2020TylerWCM3231-3290000009410000

Hi  @sprakash1192 ,

 

Or you can use "earlier" function:

Total = SUMX(FILTER('Table','Table'[Key]=EARLIER('Table'[Key])),'Table'[Total_WCM_EUs])

And you will see:

Annotation 2020-08-20 095342.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

@sprakash1192 try this

 

Total  = 
CALCULATE ( SUM ( Table[Total] ), ALLEXCEPT ( Table, Table[Key] ) )

 

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.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.