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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
roniedhaka
Frequent Visitor

new table from existing table with rows contains specific word/text in specific column

hi,

 

i need help to extract specific word/text from a string of characters - like text/word example 'wifi' or 'wi-fi' or 'AP' etc and generate a new table with only rows with that contain specific text/word from a specific column cell.

 

lets say i have a existing power BI table with 100+ rows and 8 columns. in some rows has this type of text/word in column number-4.

I need to generate a new table with rows contains that informations (rows contain that text/word) & discard rest of rows. How?

2 ACCEPTED SOLUTIONS

@roniedhaka , try this

New Table = FILTER('Table',
CONTAINSSTRING('Table'[fruits],"Mango") ||
CONTAINSSTRING('Table'[fruits],"lichie") ||
CONTAINSSTRING('Table'[fruits],"lichee"))

Arul_0-1707371739335.png





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


View solution in original post

@roniedhaka ,

this should work,

New Table = FILTER(
    'Table',
    (CONTAINSSTRING('Table'[fruits], "Mango") ||
     CONTAINSSTRING('Table'[fruits], "lichie") ||
     CONTAINSSTRING('Table'[fruits], "lichee")) &&
    ('Table'[year] = 2023 || 'Table'[year] = 2021)
)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


View solution in original post

8 REPLIES 8
Arul
Super User
Super User

@roniedhaka ,

Can you provide atleat 5-10 rows of sample data?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


country-idaccount-idfruitsweight /kgprice total kusdyear
1234abcd123mango4321152021
5678efgh456lichee1234182022
3456ijkl789dates_mango_orange2468222024
6789mnop246Mango-steen1357212021

 

here is an example table.

i need to transform this table into a new table but limited rows which fruits column contains the word 'mango' or 'Mango' or 'Mango-steen' (appearently 3 rows as per above table, and rest rows discarded).

@roniedhaka ,

try this

New Table = FILTER('Table',CONTAINSSTRING('Table'[fruits],"Mango"))

Arul_0-1707367742491.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


thanks,  sorry i ahve to add few more rows to explain a little more.

 

what i can do if also keep mango and lichee and lichi?

 

country-idaccount-idfruitsweight /kgprice total kusdyear
1234abcd123mango4321152021
5678efgh456lichee1234182022
3456ijkl789dates_mango_orange2468222024
6789mnop246Mango-steen1357212021
2468wxyz024mangosteen & apple1234202020
1357qrst135jackfruit5678192024
5432uvwx345lichie3456222023

@roniedhaka , try this

New Table = FILTER('Table',
CONTAINSSTRING('Table'[fruits],"Mango") ||
CONTAINSSTRING('Table'[fruits],"lichie") ||
CONTAINSSTRING('Table'[fruits],"lichee"))

Arul_0-1707371739335.png





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


many thanks, this should be it.

one more thing - if i want year 2021 & 2023 rows only, with those specific word/text?

@roniedhaka ,

this should work,

New Table = FILTER(
    'Table',
    (CONTAINSSTRING('Table'[fruits], "Mango") ||
     CONTAINSSTRING('Table'[fruits], "lichie") ||
     CONTAINSSTRING('Table'[fruits], "lichee")) &&
    ('Table'[year] = 2023 || 'Table'[year] = 2021)
)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


hi, thanks. that solved my problem 80%. But still i have some issues. Let me give the details of it.

the word/text i choose like mango, it is easy to extract. But in real problem i have to extraxt a specific word/text which sometimes appears inside within a big text/word and that unwanted row is chosen.

 

example - i like to extract word 'AX' & 'wifi' & 'wi-fi' only. Sometimes AX is in mix with other letters formed new word like 'Max', 'Tax', 'dax' etc. Means ax is inside of these words and those rows are unwanted.

 

i want - 

  1. only rows with containts string 'AX' only. Not mix with other letter. Those max, tax, dax rows we can avoid.
  2. If max, tax, dax type rows contain 'wifi' or 'wi-fi' - i need that row.
  3. 'wifi' text also need with same attributes like point-1, only word with 'wifi' or 'wi-fi'

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.