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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
automated_user
Frequent Visitor

For each instance a string value appears in a column add to a sum for that specific value

Hi, 

I need help with getting a summed value based on the number of times a string value from one column appears in another column. For example: 

For each distinct value in a column named PartNum:

automated_user_0-1662669062676.png

take that value and find each instances of it in a column named RowCount.PseudoLines:

automated_user_1-1662669222680.png

For each instance that it is found, I need to sum up the values in the NonConfig-PN field:

automated_user_2-1662669778132.png

Thank you

1 ACCEPTED SOLUTION

I was able to figure it out through a measure. In the calculation I also filter by the given year it appears in as well.

automated_user_0-1662993312013.png

 

 

 

View solution in original post

3 REPLIES 3
v-yalanwu-msft
Community Support
Community Support

Hi, @automated_user ;

From your screenshot, I am confused as to why it is the result of 00111 (link the two figures above).

 Can you use a simple example and want the result to be output? In order to understand your logic and train of thought.

How to upload PBI in Community


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-yalanwu-msft NonConfig-PN can be any range of numbers. But here is an example:

PartNumRowCount.PseudoLinesNonConfig-PNTotal
aaabbb42
cccaaa13
aaaddd02
bbbbbb26
bbbaaa16
dddccc30
aaaddd02

So if you take 'aaa' from PartNum and find each instances of it in the RowCount.PseudoLines.. for that instance it appears you would sum up the NonConfig-PN in that row it appears in. So the Total would be '2' for 'aaa'. 

Hope this helps!

I was able to figure it out through a measure. In the calculation I also filter by the given year it appears in as well.

automated_user_0-1662993312013.png

 

 

 

Helpful resources

Announcements
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.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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