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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
MrKwanorama
Employee
Employee

Supply chain measure - In Stock Percentage

For demand planning, I am looking to create an overview of a company in-stock-percentage or ISP.

Challenge is, that I have the same partnumbers on multiple locations and need the ISP as one consolidated percentage of Category regardless of location.

  • How do I create a measure to return the percentage of Category holding Inventory of Partnumber in any Plant?
  • For reference, Drillsystem ISP in below table is 75% since 6 of 8 partnumbers are in stock in any given Plant

 

CountryCategoryPartnumberPlantInventory
ESDrillsystempart1warehouse12
ESDrillsystempart1warehouse20
ESDrillsystempart2warehouse10
ESDrillsystempart2warehouse25
ESDrillsystempart3warehouse10
ESDrillsystempart3warehouse20
ESDrillsystempart4warehouse10
ESDrillsystempart4warehouse24
ESDrillsystempart5warehouse15
ESDrillsystempart5warehouse22
ESDrillsystempart6warehouse10
ESDrillsystempart6warehouse20
ESDrillsystempart7warehouse15
ESDrillsystempart7warehouse22
ESDrillsystempart8warehouse10
ESDrillsystempart8warehouse25
     

 

 

 

1 ACCEPTED SOLUTION
v-eqin-msft
Community Support
Community Support

Hi @MrKwanorama ,

 

According to my understanding, you want to calculate the ratio of distinct PartNumber when Inventory<>0 of each Country and each Category, right?

If so , please try:

Drillsysytem ISP = 
var _partNo= CALCULATE(DISTINCTCOUNT('Table'[Partnumber]), ALLEXCEPT('Table','Table'[Country],'Table'[Category]))
var _inveNo= CALCULATE(DISTINCTCOUNT('Table'[Partnumber]),FILTER(ALL('Table'),[Country]=MAX('Table'[Country]) && [Category]=MAX('Table'[Category]) && [Inventory]<>0))
return DIVIDE(_inveNo,_partNo)

Eyelyn9_0-1646718753782.png

 

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

View solution in original post

4 REPLIES 4
v-eqin-msft
Community Support
Community Support

Hi @MrKwanorama ,

 

According to my understanding, you want to calculate the ratio of distinct PartNumber when Inventory<>0 of each Country and each Category, right?

If so , please try:

Drillsysytem ISP = 
var _partNo= CALCULATE(DISTINCTCOUNT('Table'[Partnumber]), ALLEXCEPT('Table','Table'[Country],'Table'[Category]))
var _inveNo= CALCULATE(DISTINCTCOUNT('Table'[Partnumber]),FILTER(ALL('Table'),[Country]=MAX('Table'[Country]) && [Category]=MAX('Table'[Category]) && [Inventory]<>0))
return DIVIDE(_inveNo,_partNo)

Eyelyn9_0-1646718753782.png

 

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

Oh - was too fast there. What I need is to calculate the ratio of instock for the category. E.g. if we have inventory on 7 of 10 partnumbers in any plant, the ISP is 70% for the category.

Perfect - thank you so much

MrKwanorama
Employee
Employee

MrKwanorama_0-1646404702398.png

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.