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.
Hi,
I am pretty new to Power BI so I will use my work to explain.
I found the distinct count of customers who purchased specific products. Measure: No. Sold In = DISTINCTCOUNT(Table Name[CustomerNames]).
I now need to find the *Total No. of Customers who made purchases. I assumed SUM(DISTINCTCOUNT(Table Name[CustomerNames])) would work but of course it didn't among several other options.
See pic below (actual products blocked out).
Coverage % = No. Sold In (mentioned above) / *Total No. Distinct Customers (circled in red in pic and mentioned above)
I used the actual no. of distinct customers in Coverage % calculation (seen in pic) to show why the sum of the distinct count is necessary.
A generalized DAX expression or formula is necessary as the aactual value will vary from month to month and these values will also be filtered per month.
Any assistance will be appreciated!
You can use your customer count measure and apply a filter to only count customers that are in your sales table. It will be something like this.
Customers with Sales = CALCULATE ( [No. Sold In], YourSalesTable )
Hi @jdbuchanan71,
Firstly, thank you for your response!
Your measure yields the correct total however, when done on a row by row level for each product in the visual,
No. Sold In = Customers with Sales hence eg. Coverage = 74/74 = 1 = 100%
Sorry, I misunderstood. I thought you were wanting to go the other way. You can write your measure to calculate the total customers for all sales over the product specific like so.
Coverage % =
VAR _All = CALCULATE( [No. Sold In], ALL ( Sales ) )
RETURN
DIVIDE( [No. Sold In], _All )
Hi @jdbuchanan71 ,
This measure works!
Thank you for taking the time to recreate the table and insert visuals.
Your assistance is very much appreciated!!!
Hi @lm_i ,
Glad to hear that your issue has been solved,could you pls mark the reply as answered to close it?
Much appreciated.
Hi @v-kelly-msft ,
I have been trying to mark as the solution, however it keeps saying authentication has failed.
Hi @lm_i ,
Refresh your page then enter your user name and password.🙂
Hi @v-kelly-msft,
I am still not able to mark the solution. I received the same error message several times.
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 |
---|---|
110 | |
102 | |
86 | |
77 | |
68 |
User | Count |
---|---|
120 | |
108 | |
98 | |
83 | |
77 |