Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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.