Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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]
)
)
)
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 38 | |
| 33 | |
| 29 | |
| 26 |
| User | Count |
|---|---|
| 131 | |
| 105 | |
| 60 | |
| 56 | |
| 55 |