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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Frankcf
Frequent Visitor

Create a SUM measure that sums conditionally (based on a value in another column)

hi

i have two colums in by Bi

column 1 contains lot #, column 2 contains units

Lot                                units

L11551                         25

L11551                         25

L11524                         15

L11523                         34

L11523                         10

L11523                         12

i want add the sum the units based on the lot #

the results i am looking for are the following

 

L11551                         50       ( add the 2 rows that have the same lot # together)

L11524                         15

L11523                         56       (add the 3 rows that have the same lot # together)

 

any help would be apprecieated

 

Regards

5 REPLIES 5
ricardocamargos
Continued Contributor
Continued Contributor

Hi @Frankcf,

 

In addiction what @Anonymous said, if u can't find this "SUM" option you have to check if this column is numeric, if no just change it.

 

Ricardo

Greg_Deckler
Super User
Super User

You can do that with a Table visualization. If you put in your Lot column and then put in your units column with a SUM aggregation then you should have what you want.


@ 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!:
The Definitive Guide to Power Query (M)

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

Hi @Frankcf,

 

You can right click on Units in the Values field and select 'Sum' instead of 'Don't Summarize' which seems to be selected in your case.

Hi

i am confused, but back and still trying to figure this out.

in the example below i want to sum the pcs column based on the number of time the same  internal lot is shown

in the example below i can see that internal lot No_ L1196480 is shown on 3 rows, the pcs for each row is 750.

the value i am looking for is 2250, for 750+750+750 = 2250

 

i cannot figure out how to count the # of times an internal lot is repeated and sum only that amout of pcs.

 

Capture.JPG

 

take a table visual, drop lot number and pcs in values, and drop down next to pcs and make sure aggregation  method is sum, if you don't see aggregation method, it means your pcs column is not a numeric field. if that is the case, select pcs column, go to modelling tab and change the data type to whole number.

 

 



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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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