Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowTry your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now
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]
)
)
)
| User | Count |
|---|---|
| 23 | |
| 19 | |
| 19 | |
| 17 | |
| 11 |
| User | Count |
|---|---|
| 55 | |
| 55 | |
| 41 | |
| 40 | |
| 30 |