Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello guys,
I´m trouble because I can´t create some analysis that use to be comum to do in SQL
1) I need to do a measure that distinctcount CPF from table A and test if the same CPF is in the table B and C
2) I need to do other mesasure similar the last one, but now, I need count CPF from table A that exists in table C but not in table B
Solved! Go to Solution.
Hi, @Anonymous
According to your description, you can try the following formulas:
1) You want to distinct count CPF in Table A that also exists in CPF in Table B and C.
CPF in B&C =
CALCULATE (
DISTINCTCOUNT ( A[CPF] ),
FILTER ( A, [CPF] IN VALUES ( B[CPF] ) && A[CPF] IN VALUES ( C[CPF] ) )
)
2)You want to distinct count CPF in Table A that exists in Table C but not in Table B
CPF in C NOT B =
CALCULATE (
DISTINCTCOUNT ( A[CPF] ),
FILTER ( A, [CPF] IN VALUES ( C[CPF] ) && NOT ( A[CPF] IN VALUES ( B[CPF] ) ) )
)
Best, Regards,
Paul Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous
According to your description, you can try the following formulas:
1) You want to distinct count CPF in Table A that also exists in CPF in Table B and C.
CPF in B&C =
CALCULATE (
DISTINCTCOUNT ( A[CPF] ),
FILTER ( A, [CPF] IN VALUES ( B[CPF] ) && A[CPF] IN VALUES ( C[CPF] ) )
)
2)You want to distinct count CPF in Table A that exists in Table C but not in Table B
CPF in C NOT B =
CALCULATE (
DISTINCTCOUNT ( A[CPF] ),
FILTER ( A, [CPF] IN VALUES ( C[CPF] ) && NOT ( A[CPF] IN VALUES ( B[CPF] ) ) )
)
Best, Regards,
Paul Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @V-pazhen-msft
Thanks a lot for your help.
I really apreciated your solution. It´s simple and clear. It´s works perfectly.