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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
arth78
Frequent Visitor

Power Query : Select a line from a list

Hello,

 

I'm a new user of PowerBI and I need your help to find a Power Query formula.

 

I have a column which contains a list of lines and I need to create a column which select a single line when it contains the expression "PRIO2". I'm probably not really understandable so I made a screen that explain what I want :

 

example.png

 

Can you help me to find the right Power Query formula to do that ?

 

Any help would be appreciated. 

1 REPLY 1
WanderingBI
Resolver III
Resolver III

Hi!

 

You could use the following formulas as in this example.

 

You can copy this code into the advanced editor of a new blank query to run it:

let
    Source =  #table(
    {
      "Task",  
      "Status" 
    }, 
    {
      {
       "Task1",{"status1 pending","status2 pending"}   },
      {
        "Task2",{"status1 pending","text PRIO2","text PRIO2"}
      }
    }
  ),
    extractOccurence = Table.AddColumn(Source, "extract", each List.FindText(_[Status], "PRIO2")),
    checkOccurenceCount = Table.AddColumn(extractOccurence, "containsPRIO2", each if List.Count(_[extract]) >0 then true else false, type logical)
in
    checkOccurenceCount

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors