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
TPB_Paul
Frequent Visitor

Creating a new table from columns in an existing table with only rows that contain specific text

I have treid in vain to create a new table that only has some of the rows in the original and would appreciate some help.

 

I have a table called 'Stuff'.  It has many columns and a lot of rows.  I want to create a new table called 'SomeStuff' that only has the rows who's column 'strategies' contains the phrase 'Technology-'.

 

I have tried using CONTAINS and IF and FILTER and have no success.  

 

The corrext DAX would be greatly appreciated.

 

 

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

Hi @TPB_Paul

 

You can create a new Calculated Table as follows

 

Go to Modelling Tab>> New Table

 

New Table =
FILTER (
    ADDCOLUMNS ( stuff, "Check", FIND ( "Technology-", Stuff[Strategies],, 0 ) ),
    [Check] > 0
)

 

Also you can add a calculated Column and filter the results using this column

 

Column =
FIND ( "Technology-", Stuff[Strategies],, 0 )

Regards
Zubair

Please try my custom visuals

View solution in original post

3 REPLIES 3
Zubair_Muhammad
Community Champion
Community Champion

Hi @TPB_Paul

 

You can create a new Calculated Table as follows

 

Go to Modelling Tab>> New Table

 

New Table =
FILTER (
    ADDCOLUMNS ( stuff, "Check", FIND ( "Technology-", Stuff[Strategies],, 0 ) ),
    [Check] > 0
)

 

Also you can add a calculated Column and filter the results using this column

 

Column =
FIND ( "Technology-", Stuff[Strategies],, 0 )

Regards
Zubair

Please try my custom visuals

This was a great help for usin g the FIND.  However my main problem is the fact that PowerBI does not save the settings for a filter and I need that functionality so that each department only sees their data.  If I could combine FIND and FILTER I could solve the problem.  If I have a column named DEPT, and out of all the departments I want to filter 'SPORTS', is there a way I could create a column that would act as a filter to only show data for the SPORTS department?

 

This would solve all my filtering problems until there is a way to save default filtering in a report.

 

 

Worked great.  Thanks so much !!

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.

Top Solution Authors