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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Sum of values of different categories

Dear all, 

 

I'm new to Power BI/Dax in general so apologize if this might seems obvoious but I couldn't manage to find a way to do it.

 

I'm working with data related to stock.  We have some final products which experience some processes from the raw material to the end, so it is possible to find different stocks of a product in every stage (they are considered as different products, although all of them depend on the final product).  What I want to know is the quantity of items we have in stock for each product filtering by customer.

 

As you can see, I am already calculating the stock we have of final products, but the rest of processes are showing us stock 0.

 

We have the following related data:

- Stockeuroal (warehouse 1)

- StockTotales (warehouse 2)

- Maestro_Ref (the categories of each code)

- PT (the structure; codes for the products related to the final product while are being processed)

 

image.png

 

Table PTTable PT

Table Maestro_RefTable Maestro_RefTable StockTable Stock

In order to know the stock por each process, we have calculated some measures:

Stock_PT = CALCULATE(SUM(StockTotales[Stock])+SUM(StockEuroal[Stock]), FILTER(Maestro_Ref, Maestro_Ref[Atributo] = "Ref_PT"))+0
 
Stock_PC2 = CALCULATE(SUM(StockTotales[Stock])+SUM(StockEuroal[Stock]), FILTER(Maestro_Ref, Maestro_Ref[Atributo] = "Ref_Pcurso2"))+0
 
etc
 
Thanks in advance
 
1 REPLY 1
lbendlin
Super User
Super User

your data model is inside out.  Reference tables are dimensions and need to be on the outside of the model.  your stock values are facts and need to be at the center of the data model.  Also, your components do not depend on the final product - the final product depends on the components.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

Top Solution Authors
Top Kudoed Authors