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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Sum per group (with PBI example file)

Hi guys,

 

i have a table looking like this and i want to create the Group sum in each row for each article. So basically i want to add the numbers in the red circle as a measure to the table: 

 

Unbenannt.PNG

You can find the mini example here:

 

https://www.file-upload.net/download-14004880/Example.pbix.html

 

And how can i better attach example files to questions than with a link like that?

 

Thanks!

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

So I would think:

 

Measure = 
  VAR __Group = MAX('Table'[Article Group])
  VAR __Table = FILTER(ALL('Table'),[Article Group] = __Group)
RETURN
  SUMX(__Table,[Stock reach days])


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Greg_Deckler
Super User
Super User

So I would think:

 

Measure = 
  VAR __Group = MAX('Table'[Article Group])
  VAR __Table = FILTER(ALL('Table'),[Article Group] = __Group)
RETURN
  SUMX(__Table,[Stock reach days])


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Perfect it works! Thansk alot

Great!


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.