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
JohnGray
Helper I
Helper I

Measures to extract all values after a specific text string

Hello,

I have a data feed coming in from a source that lumps all Customer IDs together into one column, even though there are different "categories" of customers. The customer IDs are in a single column much like this:

JohnGray_0-1686257952952.png

 

I would like to be able to use a measure to extract only the customer with the DAX ID, with the result of the measure showing the full ID (i.e., DAX123456789, etc). What would be the best way to go about doing this? 

 

Please note: I am using a live Power BI data dataset connectivity and as such must use a measure; I cannot create clumns or access Power Query. 

3 REPLIES 3
v-rzhou-msft
Community Support
Community Support

Hi @JohnGray ,

 

I suggest you to create a measure as below.

Filter = 
IF(CONTAINSSTRING(MAX('Table'[Subject ID]),"DAX"),1,0)

Add this measure into visual level filter and set it to show items when value = 1.

vrzhoumsft_0-1686552838924.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello Rico,

 

Thank you for your suggestion. This does indeed work if I put the data into a Table View, but if I try to put it into say, a Pie Chart, it doesn't show distinct values and only shows a single "1" for the whole pie chart. Do you know if theres a way to count all the 1 values as distinct values so they can be better visualized? 

vicky_
Super User
Super User

You'll want to look at the CONTAINSSTRING() function as a filter for that column when creating measures. https://learn.microsoft.com/en-us/dax/containsstring-function-dax

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.