Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Sign up nowGet Fabric certified for FREE! Don't miss your chance! 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]
)
)
)
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 63 | |
| 62 | |
| 42 | |
| 19 | |
| 16 |
| User | Count |
|---|---|
| 113 | |
| 105 | |
| 36 | |
| 28 | |
| 28 |