Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello Experts,
I am looking for help for calculating the Total Count of Distinct Customer Names in Customer Dimension based on a Measure (M Value) in DimCustomer and at the same time the count should be dynamic to change with filter selection. Something like
My Data Model is like
Here
M Value = SUMX(RELATEDTABLE(FactSales),FactSales[Revenue] )
Customer Count = COUNTROWS(ALL(DimCustomer[CustomerName]))
I know I did COUNTROWS on ALL and no filter will be applied. So what I am looking for is
CustomerCount where
Solved! Go to Solution.
Hi @Anonymous ,
Please refer to the following measure:
Customer Count = CALCULATE(Distinctcount(DimCustomer[CustomerName]),FILTER(ALLSELECTED(DimCustomer),[M Value]<> Blank())
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
@Anonymous ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Try
Customer Count = Distinctcount(DimCustomer[CustomerName])
or
Customer Count = calculate(Distinctcount(DimCustomer[CustomerName]),all(DimCustomer))
Hi @amitchandak
Distinct Count wont work as it will give me the count = 1 at each customer level where as i want total count
and Customer Count = calculate(Distinctcount(DimCustomer[CustomerName]),all(DimCustomer)) is same as
Hi @Anonymous ,
Please refer to the following measure:
Customer Count = CALCULATE(Distinctcount(DimCustomer[CustomerName]),FILTER(ALLSELECTED(DimCustomer),[M Value]<> Blank())
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
Thanks Dedmon,
The solution is acceptable. I was close enough but could not strike ALLSELECTED
Customer Count = CALCULATE(Distinctcount(DimCustomer[CustomerName]),FILTER(DimCustomer,[M Value]<> Blank())
User | Count |
---|---|
116 | |
73 | |
60 | |
48 | |
48 |
User | Count |
---|---|
171 | |
122 | |
60 | |
59 | |
56 |