Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

Distinct count overlap

I'm not sure how to being to solve this problem:

 

I have business data with client IDs and Location names, I've created a table with the location names as a column and a distinct count of clients as another. I realized that this distinct count is for distict client ids across all of our locations, so the disticnt counts for each row (locations) do not sum up to the total. I created a measure that sumerizes the distinct count of client Ids within each loaction so that the column totals add up using SUMMERIZE. 

 

What I want to know is, how do I figure out which locations have disinct client overlaps and by how much?

example:

 

Location    DefaultDisitinctCount    MyDistinctCountMeasure

AAA            100                                   100

BBB               50                                     50

Total           145                                   150

 

So this tells me that there are 5 distinct clients that overlap for these 2 locations

 

I know the tricky part is going to be that multiple locations can have client overlap.

 

Any help would be great!

 

1 ACCEPTED SOLUTION

This will give you a table with common values. Change as per need

 

 

Table = INTERSECT(ADDCOLUMNS(FILTER(Sales,Sales[Sales Date] >= date(2018,06,30)),"AA",Sales[Sales Date]),ADDCOLUMNS(FILTER(Sales,Sales[Sales Date] >= date(2018,06,29)),"AA",Sales[Sales Date]))

 

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

Please explore intersect

 

https://docs.microsoft.com/en-us/dax/intersect-function-dax

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.

Anonymous
Not applicable

@amitchandak 

 

I'm not sure how I would use intersect in this case. I don't have 2 tables of data and I want to see the intersect between all of the locations, which are values in a single column.

 

 

Thanks

This will give you a table with common values. Change as per need

 

 

Table = INTERSECT(ADDCOLUMNS(FILTER(Sales,Sales[Sales Date] >= date(2018,06,30)),"AA",Sales[Sales Date]),ADDCOLUMNS(FILTER(Sales,Sales[Sales Date] >= date(2018,06,29)),"AA",Sales[Sales Date]))

 

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.