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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Average In Stock % Matrix

Hello,

 

I am trying to build a matrix showing an average in stock % that drills down by 'Warehouse Master'[Warehouse ID], 'Vendor Master'[Vendor Name], and 'Item Master'[Item Number & Description].

 

The average needs to iterate through each day on record and calculate the in stock % by doing the sum of 'Inventory Snapshot'[Qty] (from the previous day) (built key measure Historical On Hand for this) and dividing that by sum of 'Order Detail'[Qty Ordered] (built key measure Total Store Qty Ordered for this). 

 

Additional note: If the in stock % on a given day is greater than 100% then it should return 100%, meaning that 100% is the hard ceiling.

 

Any help is appreciated.

 

https://1drv.ms/u/s!AiFttrDOn_FqgRS6FfaNLXA2zmLZ?e=jngT15

2 REPLIES 2
v-xuding-msft
Community Support
Community Support

Hi @Anonymous ,

By my test , your measure is worked. I changed the relationship between table “DateTable” and table “Inventory Adjustment” from single to both. Then the measure of “Historical On Hand” and “Avg In Stock% ” are worked. If the values are not what you want, please post the expected output.

00.jpg11.png

 

Best Regards,

Xue Ding

 

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

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hello Xue Ding, @v-xuding-msft 

 

The problem with this solution is that this appears to just be adding up the Historical On Hand and dividing it by the Total Store Qty Ordered (image below). I need the Avg In-Stock % to iterate through each date and do Historical On Hand / Total Store Qty Ordered by item and then be able to roll it up to the vendor and then warehouse level. From a visual standpoint all I need is a matrix that has Warehouse ID/Vendor Name/Item Number & Description and then the corresponding avg in stock %. Also note that the vendor level logic is broken (image below).

 

Warehouse LevelWarehouse LevelVendor LevelVendor Level

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.