This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hi everyone,
I need to count the orders that are processed and those that are not processed.
| Orders ID | Quantity | Quantity NP |
| 1 | 10 | 0 |
| 2 | 20 | 0 |
| 3 | 12 | 0 |
| 4 | 5 | 0 |
| 4 | 6 | 6 |
| 5 | 8 | 0 |
| 6 | 14 | 0 |
| 6 | 14 | 0 |
| 6 | 26 | 26 |
| 7 | 14 | 0 |
| 7 | 16 | 0 |
| 8 | 18 | 0 |
| 9 | 29 | 0 |
| 10 | 10 | 0 |
| 10 | 10 | 0 |
in this example the result expected is:
n. order proessed = 8
n. order not processed = 2
because the orders 4 and 6 have some rows not processed
if I use these measures:
N. Order Prcoessed =
CALCULATE(
DISTINCTCOUNT(Table 1[Orders Id]),
Table 1[Quantity NP] = 0
)
N. Order NOT Prcoessed =
CALCULATE(
DISTINCTCOUNT(Table 1[Orders Id]),
Table 1[Quantity NP] <> 0
)
the result count the orders n. 4 and 6 in both measures.
because the have half rows that are processed and half not processed.
n. order proessed = 10
n. order not processed = 2
I hope you can help me.
Regards
GM
Solved! Go to Solution.
@nannimora - Perhaps:
N. Order Prcoessed =
VAR __Table = SUMMARIZE('Table 1',[Orders Id],"NP",SUM('Table 1'[Quantity NP]))
RETURN
COUNTROWS(
DISTINCT(
SELECTCOLUMNS(
FILTER(__Table,[NP] = 0),
"Orders Id",[Orders Id]
)
)
)
@nannimora , Try like. Change Table name and column name as per need
N. Order Prcoessed =
countx(filter(summarize(Table,Table[Orders ID], "_1", sum(Table[Quantity NP])),[_1]=0),[Orders ID])
N. Order NOT Prcoessed =
countx(filter(summarize(Table,Table[Orders ID], "_1", sum(Table[Quantity NP])),[_1]<>0),[Orders ID])
@nannimora - Perhaps:
N. Order Prcoessed =
VAR __Table = SUMMARIZE('Table 1',[Orders Id],"NP",SUM('Table 1'[Quantity NP]))
RETURN
COUNTROWS(
DISTINCT(
SELECTCOLUMNS(
FILTER(__Table,[NP] = 0),
"Orders Id",[Orders Id]
)
)
)
Check out the April 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 |
|---|---|
| 35 | |
| 27 | |
| 26 | |
| 22 | |
| 18 |
| User | Count |
|---|---|
| 67 | |
| 36 | |
| 32 | |
| 26 | |
| 23 |