Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hello,
I have a list of products and the available inventory for each product on a specific day. I simply want to count the product when the available inventory is > 0, but it returns the full count of products, no matter the qty.
I've done various forms of Counts, this is the current one:
Solved! Go to Solution.
Hi @cassidy ,
Count Stock =
COUNTROWS (
FILTER ('Product Details',[Avail Status Units BOW (calc)] >0 )
)
Please share sample data if this does not work.
Regards,
HN
Use an IF statement?
InStockCount =
var v_bow = CALCULATE(SUM('Table'[Avail Status BOW])) // your calculation
return
IF(v_bow>0;1;0)
Proud to be a Super User!
Awesome Keyboard Shortcusts in Power BI, thumbs up if you like the article
My Community Blog Articles (check them out!)
My Blog - Power M code to automatically detect column types -
How to create test data using DAX!
Hi @cassidy ,
Count Stock =
COUNTROWS (
FILTER ('Product Details',[Avail Status Units BOW (calc)] >0 )
)
Please share sample data if this does not work.
Regards,
HN
@harshnathani , this seems to work! Thanks
Are you able to easily explain why mine did not work? I thought I was counting rows with the COUNTX.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
16 | |
13 | |
12 | |
11 | |
11 |
User | Count |
---|---|
19 | |
14 | |
14 | |
11 | |
9 |