web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / how to filter in excel...
Power Automate
Answered

how to filter in excel datatable

(0) ShareShare
ReportReport
Posted on by 29

I would like to know how to filter only rows where the value of column 'a' in a data table is an even number.

ShotImages_20230913_125907.jpg
I have the same question (0)
  • v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Hi @chobo_power0901 ,

     

    Do you want to get the even values in a column in Excel? Please try this:

    vmengmlimsft_0-1694582663384.png

    vmengmlimsft_1-1694582722319.png

     

    If you want to filter the records with even numbers in a column, please try this:

    vmengmlimsft_2-1694584943635.png

    vmengmlimsft_3-1694584994378.png

     

     

    Best regards,

    Rimmon Li

     

     

     

  • chobo_power0901 Profile Picture
    29 on at

    thank you...

     

    but, i wanna ...

    I would like to know how to use it in desktop flows.

    ShotImages_20230913_171258.jpg
  • v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Hi @chobo_power0901 ,

     

    I guess I didn't notice the tag of your question.

     

    Best regards,

    Rimmon Li

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    The easiest way to do it would be reading the data from Excel via a SQL query. You can then set the filters in the query. See here for more reference on how to do it: https://learn.microsoft.com/en-us/power-automate/desktop-flows/how-to/sql-queries-excel

     

    Otherwise, you would need to process your table via C#/Python or similar scripts, or create a new table, loop through the Excel data and insert even numbers into the new table. Either way it is less efficient than running a SQL query to Excel.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • Verified answer
    chobo_power0901 Profile Picture
    29 on at

    thank you

    I'm trying to find an even value with a sql statement, but it says it's a grammar error.

    where [num] % 2 = 0

    Could you please check?

  • chobo_power0901 Profile Picture
    29 on at

    WHERE [NUM]  MOD 2 = 0

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Can you please share the entire SQL statement, if you are still having a problem?

  • Verified answer
    chobo_power0901 Profile Picture
    29 on at

    SELECT [NUM]
    FROM [%str_sheetName_Num%$]
    WHERE [NUM] MOD 2 = 0
    ;

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    MOD is a MySQL function. In this case you do actually need to use the % operator. But PAD reserves % as the character for variable notation. So, you need to escape it. The correct way to escape % is to use %%. So, try this:

    SELECT [NUM]
    FROM [%str_sheetName_Num%$]
    WHERE [NUM] %% 2 = 0

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • chobo_power0901 Profile Picture
    29 on at

    땡규

     

    이미 성공을 했어.

     

    아래의 쿼리로 실행이 되었어

    WHERE [NUM] MOD 2 = 0

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 223

#2
David_MA Profile Picture

David_MA 210 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 175

Last 30 days Overall leaderboard