The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I want to count the number of distinct products where sum of sales are equal to zero.
Product and sales query are related by product.
The sales query may not have all products so the product must come from the product query not from the sales query.
Couple of methods below have been tried and not working:
SUMX(VALUES('Product'[Product Name]), IF(SUM(Sales[Amount]) = 0, 1))
CALCULATE(COUNT('Product'[Product Name]), FILTER(ALL('Sales'), SUM(Sales[Amount]) = 0 ))
Solved! Go to Solution.
Hi @009co ,
How about this one here:
Measure = CALCULATE ( DISTINCTCOUNT ( 'Product'[Product Name] ), FILTER ( VALUES ( 'Product'[Product Name] ), CALCULATE ( SUM ( 'Sales'[Amount] ) ) = 0 ) )
Let me know if this helps 🙂
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/
Did I answer your question❓➡️ Please, mark my post as a solution ✔️ |
Also happily accepting Kudos 🙂 |
Feel free to connect with me on LinkedIn! | |
#proudtobeasuperuser | |
Hi @009co ,
How about this one here:
Measure = CALCULATE ( DISTINCTCOUNT ( 'Product'[Product Name] ), FILTER ( VALUES ( 'Product'[Product Name] ), CALCULATE ( SUM ( 'Sales'[Amount] ) ) = 0 ) )
Let me know if this helps 🙂
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/
Did I answer your question❓➡️ Please, mark my post as a solution ✔️ |
Also happily accepting Kudos 🙂 |
Feel free to connect with me on LinkedIn! | |
#proudtobeasuperuser | |
User | Count |
---|---|
26 | |
10 | |
8 | |
6 | |
6 |
User | Count |
---|---|
32 | |
13 | |
10 | |
10 | |
9 |