March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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"}))
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
134 | |
91 | |
89 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
72 | |
68 |