This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hello,
I am working with a table with columns Item, _and sales. Somes of the items has 0 sales. I need a measure which I use to show in a data card which shows the percent of items with 0 sales for a department. I can use Department as visual filter if needed and sort the data for a deparment first and then add measure on the top. Is this the right approach.
Appreciate any guidance.
Thank you
Solved! Go to Solution.
Hi, @rkgundabhat
You can try the following methods.
Measure =
Var _N1=CALCULATE(COUNT('Table'[Item]),FILTER(ALLEXCEPT('Table','Table'[Department]),[Sales]=0))+0
Var _N2=CALCULATE(COUNT('Table'[Item]),ALLEXCEPT('Table','Table'[Department]))+0
Return
DIVIDE(_N1,_N2)
Is this the result you expect? Please see the attached document.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @rkgundabhat
Can you provide sample data for testing? Sensitive information can be removed in advance. What kind of expected results do you expect? You can also show it with pictures or Excel. I look forward to your response.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I apologize for the delay. Here is a sample data. Items are unique. What I want to do is to find out for any given department what is percentage of items with 0 sales
| Department | Item | Sales |
| Dept1 | P1 | 4 |
| Dept1 | P2 | 5 |
| Dept2 | P3 | 0 |
| Dept2 | P4 | 4 |
| Dept3 | P5 | 5 |
| Dept3 | P6 | 0 |
| Dept4 | P4 | 0 |
Hi, @rkgundabhat
You can try the following methods.
Measure =
Var _N1=CALCULATE(COUNT('Table'[Item]),FILTER(ALLEXCEPT('Table','Table'[Department]),[Sales]=0))+0
Var _N2=CALCULATE(COUNT('Table'[Item]),ALLEXCEPT('Table','Table'[Department]))+0
Return
DIVIDE(_N1,_N2)
Is this the result you expect? Please see the attached document.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Try these measures
S = sum(Data[sales])
S with 0 value = countrows(filter(values(Data[Item]),[s]=0))
All items = countrows(Data)
Create a slicer of Department and select one department. Drag this measure to a card visual
P = divide([S with 0 value],[All items])
Hope this helps.
Hi @rkgundabhat
Would something like this help?
Pct of Items with No Sales =
VAR _TotalItems = DISTINCTCOUNT( 'Sales'[Item] )
VAR _ItemsWithNoSales =
COUNTROWS(
FILTER(
SUMMARIZE(
'Sales',
[Item],
"_Sales",
SUM( 'Sales'[Sales] )
),
[_Sales] < .00001
)
)
VAR _Pct =
DIVIDE(
_ItemsWithNoSales,
_TotalItems
)
RETURN
_PctLet me know if you have any questions.
Percent Inactive Products.pbix
Hi @rkgundabhat
Would something like this help?
Pct Inactive =
VAR _AllProducts =
CALCULATE(
COUNTROWS( 'Product' ),
ALL( 'Product'[ProductKey] )
)
VAR _ActiveProducts =
CALCULATE(
DISTINCTCOUNT( 'Sales'[ProductKey] )
)
VAR _InactiveProducts = _AllProducts - _ActiveProducts
VAR _Pct =
DIVIDE(
_InactiveProducts,
_AllProducts
)
RETURN
_PctLet me know if you have any questions.
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 27 | |
| 27 | |
| 25 | |
| 19 | |
| 14 |
| User | Count |
|---|---|
| 52 | |
| 47 | |
| 39 | |
| 21 | |
| 20 |