Forum Discussion
Inventory Availability Coverage
- 6 years ago
Sorry I linked to the wrong file. The file is here:
https://1drv.ms/u/s!Ancq8HFZYL_aiJBRfsmli39RRmqCOA?e=5Uo1n3
There is an Inventory table and a YesNo table.
Kind regards
Djerro123
-------------------------------
If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.
Keep those thumbs up coming! 🙂
I took the following approach. Note that this answers if you have stock in any warehouse, not all warehouses as you stated, but your results of 25%/75% seemed to indicate it was any warehouse.
1) I created a simple table to get a Yes/No based on stock:
Stock Status =
SUMMARIZE(
Inventory,
Inventory[Product],
"On Hand",
VAR IsInStock=
CALCULATE(
SUMX(
Inventory,
IF(Inventory[Quantity] > 0, 1, 0)
)
)
RETURN
IF(IsInStock > 0, "Yes","No")
)It returns this table:
Then I related that table to your inventory data as shown:
Then I created a table visual, dropping in the "On Hand" field from the Stock Status table, and the Percent Available measure from the INventory Table, which is the following measure:
Percent Available =
VAR ProductCount =
COUNTROWS(
DISTINCT( Inventory[Product] )
)
VAR TotalProductCount =
COUNTROWS(
ALL( Inventory[Product] )
)
RETURN
DIVIDE(
ProductCount,
TotalProductCount,
0
)
my PBIX file is here if you want to tinker with it.