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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Sum by categories (Table)

Hi Folks!

 

I stopped against the next wall, let's see if any good soul can help me!

 

As you can see in the picture, I have a TABLE with the next columns:

- Production Order No_ -> From Table 1

- Sample No_ -> From Table 1

- Cantidad Muestra -> Is a measure, and the original field is in Table 2

 

What I'm trying to do is to sum the field "Cantidad Muestra" by "Sample No_".

 

I have tried the next formula/Measure, without success:

 

Cantidad Muestra TRY = CALCULATE( [Cantidad Muestra]; ALLEXCEPT(Table1;Table1[Sample No_]))

 

The thing is, I need the data to  be shown without using slicers, as shown in the picture.

 

Any ideas?

 

THANK YOU!

 

Example.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Finally found the solution!

 

Cantidad Muestra TRY = CALCULATE( SUM( [Cantidad Muestra]); ALLSELECTED( ); VALUES(Table1[Sample No_]))

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Finally found the solution!

 

Cantidad Muestra TRY = CALCULATE( SUM( [Cantidad Muestra]); ALLSELECTED( ); VALUES(Table1[Sample No_]))
mwegener
Most Valuable Professional
Most Valuable Professional

Hi @Anonymous ,

 

why does the column Cantidad Muestra not aggregate?

 

Try this:

Cantidad Muestra TRY =  SUMX(SUMMARIZE(Table1, Table1[Sample No_], "@Cantidad Muestra", [Cantidad Muestra]), [@Cantidad Muestra])

 

 

If I answered your question, please mark my post as solution, this will also help others.

Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.