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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
MarioTinton
Regular Visitor

DAX Measure - Number of distinct values from delimited string

I have a table like the following:

DateVisited Customers
2017-AUG-01Bobby,John,Richard,Felicia
2017-AUG-02Albert,John

 

I want to have a measure that calculates number of unique customers within a date range. So from example data above:

  • If date slicer is set only to August 1st, it should display 4
  • If date slicer is set between August 1 and August 2, it should display 5 (John was visited twice but counted as one unique customer)

How can I achieve this in Power BI?

 

Thank you in advance!

1 ACCEPTED SOLUTION
tringuyenminh92
Memorable Member
Memorable Member

Hi @MarioTinton,

 

Go to Query Editor -> In Home tab -> Split Column -> by delimeter -> Advanced options -> Split into (Rows).

Now drag the "Vistied Customers" fields to card/chart, right click in value field and choose Count (Distinct) option. 

 

If this works for you please accept it as solution and also like to give KUDOS.

Best regards
Tri Nguyen

View solution in original post

2 REPLIES 2
kaushikd
Resolver II
Resolver II

@MarioTinton

You have to Model your data into this form.

Capture.PNG

 

To achieve this follow the steps;-

Capture.PNG

 

1. R.click on the Table and select Edit Query 

2. R.Click on VisitedCustomer Field and click on Split Column-->By Delimeter-->Comma-->At each Occurance.

3. R.Click on Date field and click on Unpivot Other Columns.(It will auto generate 2 column attribute and value)

4. Delete the Attribute Column.Rename the value column to VisitedCustomer.

5. Click on DownArrow

 Capture.PNG of the VisitedCustomerField and Uncheck the Blank field.

 

Now the Modelling is Done.

 

Create a report using it Report 

 

Capture.PNG

 

Please mark this as a solution if this is what you required.

tringuyenminh92
Memorable Member
Memorable Member

Hi @MarioTinton,

 

Go to Query Editor -> In Home tab -> Split Column -> by delimeter -> Advanced options -> Split into (Rows).

Now drag the "Vistied Customers" fields to card/chart, right click in value field and choose Count (Distinct) option. 

 

If this works for you please accept it as solution and also like to give KUDOS.

Best regards
Tri Nguyen

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors