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´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.
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 |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |