Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
115 | |
99 | |
86 | |
70 | |
62 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |