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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
janisCNH
Frequent Visitor

Problem with counts of Parts

Hello Community!

 

I have a problem by creating a report. The report should show how many types of one part is send to a dealer. Therefor, I have two tables. One table with the data in it and one table with the assignment.

What I do is to merge the queries to see which number stands for which part. Then I create for each type one new column with an if-function that gives the reply "1" or "0" and in the next column I multiply them with the oreded quantity.

I am relativ new in Power BI, Excel etc. but I think that their should be an easier way.

 

It would be really nice if somebody may give me some feedback!

 

Regards,

Janis

1 ACCEPTED SOLUTION
austinsense
Impactful Individual
Impactful Individual

Hi, great question. You're right - there's a much simpler way to accomplish this.

 

1. You don't have to merge the queries - you can keep the queries separate and create a relationship between the two tables.

2. Then you can write a measure that counts the number of parts, something like this ...

 

// If you want to count the quantity of parts that have been sold
PartsSold = SUM(Table[Quantity])

 

3. On your report you can use the type name from your assignment table and your new measure - that should sum up the quantity of products sold for each type.

Austin is VP Operations at PowerPivotPro and a professional self-service enthusiast 🙂

View solution in original post

2 REPLIES 2
austinsense
Impactful Individual
Impactful Individual

Hi, great question. You're right - there's a much simpler way to accomplish this.

 

1. You don't have to merge the queries - you can keep the queries separate and create a relationship between the two tables.

2. Then you can write a measure that counts the number of parts, something like this ...

 

// If you want to count the quantity of parts that have been sold
PartsSold = SUM(Table[Quantity])

 

3. On your report you can use the type name from your assignment table and your new measure - that should sum up the quantity of products sold for each type.

Austin is VP Operations at PowerPivotPro and a professional self-service enthusiast 🙂

Good VersionGood VersionBad VersionBad Version

 

Thank you for the quick answer! But now I have another problem. In the first picture, you see how it should look like! But unfortunately I got the one below this morning as I wanted to work with your tip.

Or are their any obvious mistakes? Do you know a solution?

 

Regards, Janis

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.