Forum Discussion

TPB_Paul's avatar
TPB_Paul
Frequent Visitor
8 years ago
Solved

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.

 

 

  • 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 )

3 Replies

  • Zubair_Muhammad's avatar
    Zubair_Muhammad
    Icon for Community Champion rankCommunity 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 )
    • TPB_Paul's avatar
      TPB_Paul
      Frequent Visitor

      Worked great.  Thanks so much !!

    • TPB_Paul's avatar
      TPB_Paul
      Frequent Visitor

      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.