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 Power BI Community!
I was wondering if anyone can help with a DAX.
I have a table with different clients and personel (from different locations) and I want to obtain an ALLSELECTED total but only counting DISTINCT clients. The table looks like this:
USER | CLIENT NAME | LOCATION
1 RONALD W A
2 RONALD W A
2 RONALD W A
3 RONALD W A
3 RONALD W A
6 STACY L A
7 JHON C B
8 GENERIC CLIENT1 B
9 GENERIC CLIENT2 B
10 GENERIC CLIENT3 C
Basically, the result Im looking for is the total of distinct clients (6) per segment and this total to repeat for every user per location. So I can calculate the number of unique clientes attended by every personel divided by the total amount of distinct clientes that
have been attended.
I tried something like this but I haven't been able to integrate the distinctcount function (is it even possible?) to this ALLSELECTED:
Solved! Go to Solution.
Hi @Anonymous ,
Calculate the number of unique clientes attended by every personel divided by the total amount of distinct clientes that
have been attended.
Here are the steps you can follow:
1. Create measure.
measure1 =
CALCULATE(DISTINCTCOUNT('Table'[Client Name]),FILTER(ALLSELECTED('Table'),'Table'[Location]=MAX('Table'[Location])))
measure1 =
CALCULATE(DISTINCTCOUNT('Table'[Client Name]),FILTER(ALLSELECTED('Table'),'Table'[Location]=MAX('Table'[Location])))
divide =
DIVIDE([measure1],[measure2])
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @Anonymous ,
Calculate the number of unique clientes attended by every personel divided by the total amount of distinct clientes that
have been attended.
Here are the steps you can follow:
1. Create measure.
measure1 =
CALCULATE(DISTINCTCOUNT('Table'[Client Name]),FILTER(ALLSELECTED('Table'),'Table'[Location]=MAX('Table'[Location])))
measure1 =
CALCULATE(DISTINCTCOUNT('Table'[Client Name]),FILTER(ALLSELECTED('Table'),'Table'[Location]=MAX('Table'[Location])))
divide =
DIVIDE([measure1],[measure2])
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
@Anonymous , Try like
CALCULATE(DistinctCOUNT(Table[CLIENT NAME]), filter(ALLSELECTED(Table1),table[segment] IN {"Segment A"}))
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 |
---|---|
114 | |
99 | |
75 | |
73 | |
49 |
User | Count |
---|---|
145 | |
109 | |
109 | |
90 | |
64 |