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
some1else
Helper II
Helper II

How to show records after wildcard

Hello guys, hope everyone is okay.

 

I've been trying to work a solution for a problem I'm facing but I'm out of ideas.

 

Consider the 2 tables below. I've setup some filters where the user starts filtering by the ID.

Each ID is composed of levels, separated by a dash.

 

User selects 1st ID level (1), then next filter shows the 2nd level (in this case only X1), then 3rd level (Y3).

 

I then need that all WO that start by those 3 levels to show up. Right now, if I click on the ID 1-X1-Y3-Z5-407 it only shows WO number 4, where it should also show the number 5, because that ID it's a child. PB should interpret something like 1-X1-Y3-Z5-407*.

 

How can I achieve this?

Sem Título.png

2 ACCEPTED SOLUTIONS
smpa01
Super User
Super User

@some1else  can be done with disconnected tables

 

smpa01_0-1634308107187.png

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

View solution in original post

Hi @some1else 

Do you want to catch select value in your slicer in your filter measure? I think selectvalue function can achieve your goal.

filter = IF(CONTAINSSTRING(MAX('Dax'[ID]),SELECTEDVALUE('Dax Slicer'[ID])),SELECTEDVALUE('Dax Slicer'[ID]),BLANK())

Here I will show you how to achieve your goal by Power Query.

Duplicate your ID column and then split your ID column by Delimiter (Custom -).

1.png

Then create a hierachy level in report view.

3.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.

View solution in original post

4 REPLIES 4
some1else
Helper II
Helper II

Thank you both for the help. I've implemented the DAX solution just because I don't understand M or Power Query very well, but will try that approach also 🙂

As for the DAX solution, works if I select the ID on a table. If the user starts selecting (using slicers) the ID levels, is there a way of the selected value in filter measure to know that selection? I've tried using variables but failed to inject them into de selectedvalue function of that measure.

Hi @some1else 

Do you want to catch select value in your slicer in your filter measure? I think selectvalue function can achieve your goal.

filter = IF(CONTAINSSTRING(MAX('Dax'[ID]),SELECTEDVALUE('Dax Slicer'[ID])),SELECTEDVALUE('Dax Slicer'[ID]),BLANK())

Here I will show you how to achieve your goal by Power Query.

Duplicate your ID column and then split your ID column by Delimiter (Custom -).

1.png

Then create a hierachy level in report view.

3.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.

smpa01
Super User
Super User

@some1else  can be done with disconnected tables

 

smpa01_0-1634308107187.png

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
speedramps
Super User
Super User

Hi some1else

 

Please consider this solution and click the thumbs up because I took effort to help and click ACCEPT SOLUTION if it fixes your problem.

 

In Power Query use parse by delimiter to create id segments, eg

 

idseg1 = 1

idseg2 = X1

idseg2 =Y3

isseg3 = Z5

idseg4 = 407

idseg5 = 101

 

Group the segments into a hierarchy

 

Then add the hierarchy to the slicer

 

Voila, you can now select any branch !

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.