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! It's time to submit your entry. Live now!
Hello guys,
i have a problem with my file, i can't make a count.
Specifically I should count how many items are of category "A" and "UP" from the table.
The fields where the "UP" state originates is the following:
KPI L-G = IF ([DIFF L-G] <0, "DWN", IF ([DIFF L-G]> 0, "UP", "INV"))
DIFF L-G = [Adv Jul] - [Adv Down]
Adv Down = CALCULATE (SUM ('SM-ABC Analysis' [Adv.]), 'SM-ABC Analysis' [Month] = "6")
Adv Jul = CALCULATE (SUM ('SM-ABC Analysis' [Adv.]), 'SM-ABC Analysis' [Month] = "7")
Thank you all
Solved! Go to Solution.
Hi @GoodMan85
I build a sample to have a test.
Try this measure.
CountANeg =
CALCULATE (
DISTINCTCOUNT ( 'SM-ABC Analysis'[Codice Art] ),
FILTER (
'SM-ABC Analysis',
'SM-ABC Analysis'[Classic QTY] = "A"
&& CALCULATE (
[DIFF L-G],
ALLEXCEPT (
'SM-ABC Analysis',
'SM-ABC Analysis'[Codice Art],
'SM-ABC Analysis'[Classic QTY]
)
) > 0
)
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@GoodMan85 Try using COUNTX(FILTER(...),...)
Hi @GoodMan85
I build a sample to have a test.
Try this measure.
CountANeg =
CALCULATE (
DISTINCTCOUNT ( 'SM-ABC Analysis'[Codice Art] ),
FILTER (
'SM-ABC Analysis',
'SM-ABC Analysis'[Classic QTY] = "A"
&& CALCULATE (
[DIFF L-G],
ALLEXCEPT (
'SM-ABC Analysis',
'SM-ABC Analysis'[Codice Art],
'SM-ABC Analysis'[Classic QTY]
)
) > 0
)
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you so much @Anonymous !
Great, working good.
I tried to do as you suggested, I have no errors in the formula but it does not allow me to view any results.
Do you have any suggestions?
@GoodMan85 I'd need some sample data to test with, I don't want to hand type in a bunch of data.
| User | Count |
|---|---|
| 55 | |
| 39 | |
| 36 | |
| 21 | |
| 19 |
| User | Count |
|---|---|
| 138 | |
| 102 | |
| 59 | |
| 36 | |
| 35 |