cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
automated_user
Frequent Visitor

Get Sum of Value by Year in one to many relationship

I have a table "Parts" that stores all information on parts in our system in a table like so:

automated_user_0-1679792326362.png

I also have a table Called "NonConfig-PN" that tracks how many parts were bought and in what year here: 

automated_user_1-1679792464281.png

here is the relationship between the two tables:

automated_user_2-1679792499532.png

What I'm trying to figure out is if it is possible to get the sum of the "Pseudo" (located in NonConfig-PN table) for each "PartNum" in the Parts table for each given year, for example I'll use TS24

automated_user_3-1679792653019.png

In the NonConfig-PN, I check the "PseudoLines" column for the given "PartNum" and then get a sum of the "Pseudo" for each given year shown here: 

automated_user_4-1679793185413.png

So, TS24 in this example would have a sum of 4 in 2021 and a sum of 3 in 2019, 0 all other years. 

 

I would like this done for all parts in the Parts Table. Any help would be appreciated, as I have been stuck on this for a while now. 

Thanks.

1 ACCEPTED SOLUTION
automated_user
Frequent Visitor

After doing a little more digging, I realized that the relationship between the two tables were pointing to the wrong columns.. Once I fixed that, I was able to get my measure to work correctly. 

View solution in original post

1 REPLY 1
automated_user
Frequent Visitor

After doing a little more digging, I realized that the relationship between the two tables were pointing to the wrong columns.. Once I fixed that, I was able to get my measure to work correctly. 

Helpful resources

Announcements
May 2023 update

Power BI May 2023 Update

Find out more about the May 2023 update.

Submit your Data Story

Data Stories Gallery

Share your Data Story with the Community in the Data Stories Gallery.

Top Solution Authors