We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hello there,
I'm facing an issue with how the distinct count works.
i have a data set containing below fields and trying to accomplish 2 line graphs
1. Opportunity ID (duplicates)
2. Region
3. 4 Products
4. quarter date
1st graph:
has Quarter date in X axis, legends are set to Region and values are set to Opportunity ID
2nd graph:
has Quarter date in X axis, legends are set to Products and Values are set to Opportunity ID
Issue:
when the Opportuity ID is set to Count and i compare both the graphs for a perticular month in a quarter the values from both graphs match.
but when the Opportunity ID is set to Count(distict) and compare, they are showing differnt values.
With Products
With Regions
Below is an example from Excel pivot and how the data show be.
| Row Labels | Jan | Feb |
| Americas | 20 | 11 |
| APAC | 5 | 5 |
| EMEA | 12 | 6 |
| LATAM | ||
| Grand Total | 37 | 22 |
| Row Labels | Jan | Feb |
| Product A | 6 | 5 |
| Product B | 10 | 9 |
| Product C | 14 | 6 |
| Product D | 7 | 2 |
| Grand Total | 37 | 22 |
Based on the posts from the above, you might refer to the official documents for more hints:
https://docs.microsoft.com/en-us/dax/distinctcount-function-dax
https://docs.microsoft.com/en-us/dax/count-function-dax
Hi @swaroopkumarmg ,
So the COUNT function counts all the rows within your dataset including duplicate values for your OpportunityID column.
But, when you use DISTINCTCOUNT on OpportunityID column, it just counts the unique values, ignoring any duplicates in this column in the data.
Thanks,
Pragati
Thank you so much for replying, the problem im facing here is not the difference between Count and Distinctcount functions.
Im using distinctcount function for OppID in both the graphs where the data set is the same but the only difference is the legend.
the objective here is to have the sum of the values in a perticulat month to be the same in both the graphs, but im getting different values.
Please go through my post completely and help me out.
thanks
@swaroopkumarmg - Right, count counts all of the rows including duplicates. Count (distinct) does not count duplicates.
Thanks for replying
but that is not my issue.
Please go through my post completely and help me out.
Thanks again
Could you plz kindly provide the dummy pbix?
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 54 | |
| 39 | |
| 34 | |
| 18 | |
| 18 |
| User | Count |
|---|---|
| 67 | |
| 62 | |
| 38 | |
| 34 | |
| 22 |