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

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

Reply
Sofinobi
Helper IV
Helper IV

sum over Stock by month

Hello again community,

please, i come back for your help again to calculate the sum of over stock,

now, i have :
1 - the measure to calculate the average quantity in stock by month [Avg Qte]
2- and with the same measure i have the average price by month [Avg Price]
2 - the measure to calculate the average sales quantity of last 3 months [Avg Sales Qte]

please, i need to calcu late The over Stock by month with equal to = ([Avg Qte]-[Avg Sales Qte])*[Avg Price]
i tried this simple measure, but it doesn't keep in mind the different ITEMs

c24bfb4e-8989-466a-be9a-65af3a4d726c.png

thank you all



6 REPLIES 6
Sofinobi
Helper IV
Helper IV

Hi, thank you for your answer,
but itsn't what i'm looking for: your measure calculate only when i filter by ITEM
me i need to calculate the global over stock and represent it in a line chart by month, also it reacts when i filter by ITEM

thank you

ERD
Community Champion
Community Champion

@Sofinobi , you can try something like 

yourmeasure =
VAR current_item = SELECTEDVALUE ( data[item] )
RETURN
CALCULATE ( YOUR_EXPRESSION, data[item] = current_item )

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.

Check out my latest demo report in the data story gallery.

Stand with Ukraine!


Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/

Thank you!

msg 3:
i have a sollution in my mind, that i create a summarized table (from 2 tables : date table and item table)
after that, i'll calculate the sum of over stock using SUMX
but i don't know how to create summarize from 2 tables
Capture2.PNG
thank you

i'll try to explain more,
what the over stock that i need is something like SUMX (line by line)
eg : ([Avg Qte]item1-[Avg Sales Qte]item1)*[Avg Price]item1 + ([Avg Qte]item2-[Avg Sales Qte]item2)*[Avg Price]item2

ERD
Community Champion
Community Champion

Please, provide some sample data (not an image) and the result you want to achieve (how it looks like calculated).

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.

Check out my latest demo report in the data story gallery.

Stand with Ukraine!


Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/

Thank you!

Hi @ERD  sorry to be late for the answer
here is the sample of my data in pbix file
actualy, the over stock value is correct only if i filter by product, if i turn off the filter the result is wrong (because the averages that i have dont take consideration of every product separately)
please if you can help.
thank you.
OverStock.pbix 

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.