Forum Discussion

Jendoren's avatar
Jendoren
New Member
3 years ago

Filter rows based on length in Power Query

Hello all! 

 

I am working with a table that has phone numbers of varying lengths in a column called dialednumber as part of the table ytd_cb. 

What I want is a query that will filter the table to only show phone numbers that are 11 digits in length.

 

Thank you! 

3 Replies

  • Jakinta's avatar
    Jakinta
    Solution Sage

    Try the step below.

    Table.SelectRows(YourPreviousStepName, each Text.Length([dialednumber])=11)

     

     

  • m_dekorte's avatar
    m_dekorte
    Resident Rockstar

    Hi Jendoren,

     

    Give this a go. Set a manual filter on that column in your table, this is just to create the bulk of the syntax.

    Next inside the formula bar update the code as highlighted here:

     

     

    Please mark this answer as solution when it helped you to resolve your question, thanks!