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 / trying to filter multi...
Power Automate
Suggested Answer

trying to filter multiple values and not able to achieve

(0) ShareShare
ReportReport
Posted on by 203
Hi Everyone,
 
I am trying to read an Excel file and filter it using multiple values, but it's not working as expected. I've attached a snapshot of the flow for reference. Kindly assist as soon as possible.
 
 
Best Regards 
Muzamil Ahmed
 
I have the same question (0)
  • stampcoin Profile Picture
    5,146 Super User 2026 Season 1 on at
    Did you get an error or something ? Please describe your intention.
  • Ahmedmuz Profile Picture
    203 on at
    I’m not getting any errors, but the filter isn’t applying to multiple values. For example, it reads and stores values like Value1, Value2, or more, and then I need to go to a specific column in another sheet and filter only those rows that match the values it read (e.g., Value1 and Value2). Hope this clarifies what I’m trying to achieve.
  • Suggested answer
    Nived_Nambiar Profile Picture
    18,136 Super User 2026 Season 1 on at
     
    Please do confirm if you have configured this way the filter cells action
     
     
    (For demo purposes, i am filtering with value 56)
     
    Then i got the result in excel sheet like below
     
     
    Is it what you are expecting ? or is it the output value you are expecting from flow ?
     
     

    Thanks & Regards,
    Nived N

    Stay connected:
    LinkedIn | YouTube | Blogs

    Was this answer helpful?
    If yes, please mark it as the solution by selecting the checkbox in the discussion thread.
    Your feedback motivates me to keep contributing. Thank you!

  • Ahmedmuz Profile Picture
    203 on at
    @Nived_Nambiar In my flow snapshot, I'm trying to filter multiple values using the filter option. For example, if the Excel data reads "56" and "86", it should apply the filter for both values together—not replace the first one with the second. Hope this clarifies what I'm trying to achieve.
  • Suggested answer
    Riyaz_riz11 Profile Picture
    4,048 Super User 2026 Season 1 on at
    Hi,
     

    Solution 1: Fix the Filter Action

    The "Filter cells in Excel worksheet" action has limitations with multiple values. Try this approach:


    1. Replace the Filter action with a more robust method:

      • Remove the "Filter cells in Excel worksheet" action

      • Use "Read from Excel worksheet" to get all data first

      • Then use "Filter data table" action instead

    2.  

    Solution 2: Proper Multiple Value Filtering

    If you need to filter by multiple values in column 'C', modify your approach:

    # Instead of using Excel's built-in filter, use these actions:
    
    1. Read from Excel worksheet (get all data)
    2. Use "Filter data table" action with these settings:
       - Column: Your target column
       - Operation: "Contains" or "Equal to"
       - Value: First filter value
       
    3. For multiple values, use "Filter data table" again on the result
       OR use a Loop to process multiple filter criteria

    Solution 3: Use Advanced Filter Syntax

    If sticking with Excel filter, ensure your filter criteria is properly formatted:


    • For multiple values: "Value1,Value2,Value3"

    • For contains: "*partial_text*"

    • For exact match: "=exact_value"


    •  

    Solution 4: Complete Revised Flow

    Here's a better structure:


    1. Get first free column/row (keep as is)

    2. Read entire data range into a data table

    3. Use Loop with conditions to filter:
      Loop through each row
      → Add condition to check if column value matches your criteria
      → If true, add row to new filtered data table
       
       
       
      If I have answered your question, please mark it as the preferred solution ✅ . If you like my response, please give it a Thumbs Up 👍.
      Regards,
      Riyaz
  • Suggested answer
    eetuRobo Profile Picture
    4,484 Super User 2026 Season 1 on at
    Can you show the "Filter cells in Excel worksheet" -action in when you open the action to edit it. It should look similar to this:


    So if you click "Edit" on the Filters to apply


    Example:
    Before filtering:

    After filtering:


    Or if you want to filter the %ExcelData% - table variable then you can use "Filter data table" -action. 
    So this is how the example ExcelData looks like:


    and we want to filter it to see only rows that have 56 and 86 in the Column2
    So Filter data table -action should look like this:



    Then the FilteredDataTable looks like this:


    Also to make the flow more efficient I would remove the Loop that you have. Right now it seems to do the same action as many times as you have rows. So it reads the same data from excel in every loop (it does not add to existing ExcelData1 but always overwrites it with the same data). And seems like you don't even need the second "Read from Excel worksheet" that is inside that needless loop. Just use the "Retrieve data table column into list" -action to the first "ExcelData" -table variable.



    So instead like this:
  • Ahmedmuz Profile Picture
    203 on at
    @eetuRobo Thank you so much. However, I understand that manually entering multiple values into the filter works—but in my case, I'm trying to pass a variable dynamically that contains multiple values (like 56 and 86) and apply the filter for all of them together at once, without manually typing each one ? how it will work 
  • Suggested answer
    eetuRobo Profile Picture
    4,484 Super User 2026 Season 1 on at
    Ah okay now I understand.

    If you don't know the amount of values you want to filter then I am not sure how to do it dynamically other than to use a script or macro on the Excel. Or have some logic that filters the Excel from the UI like you would as a user. So you would loop the list of values and choose them as filters one by one


    Here is the script method: "Run .NET script" -action you can build C# script that takes in the ExcelData -table variable that you want to filter and a list of values you want to filter the table with. 

    So in my case the script takes in %ExcelData% and %ColumnAsList% and outputs %ExcelDataFiltered% -table. So here are the Script parameters:


    The script filters the ExcelData tables Column2 with %ColumnAsList% -variables items.
    The script itself:


    .NET code to run: 
    DataView dv = new DataView(dt1);

    dv.RowFilter =  "Column2 IN (" + string.Join(",", list1) + ")";

    dt1 = dv.ToTable();


    If the column you are trying to filter is different than the Column2 then change it to be the correct one (Check the ExcelData variable column names to get the correct one).

    Result:


    Flow looks like this:


    You can copy and paste this script action to your PAD flow:
    @@CustomSummary: 'Input: ExcelData and List -variables. Output: ExcelDataFiltered'
    Scripting.RunDotNetScript Language: System.DotNetActionLanguageType.CSharp Script: $'''DataView dv = new DataView(dt1);
    dv.RowFilter =  \"Column2 IN (\" + string.Join(\",\", list1) + \")\";
    dt1 = dv.ToTable();''' @'name:dt1': ExcelData @'type:dt1': $'''Datatable''' @'direction:dt1': $'''InOut''' @'name:list1': ColumnAsList @'type:list1': $'''List''' @'direction:list1': $'''In''' @dt1=> ExcelDataFiltered

     
  • Ahmedmuz Profile Picture
    203 on at
    @eetuRobo I Tried its not working please help with any other way and please share the snap shot or flow which i can use .
     
    @Riyaz_riz11 Can you please share the snapshots what ur trying to tell with solution so we can try please. ?
     
     
    Best Regards 
    MA
  • Suggested answer
    Nived_Nambiar Profile Picture
    18,136 Super User 2026 Season 1 on at
     
    You can try this approach to filter multiple values in excel sheet, since the filter cells action does not support multiple values filtering dynamically, we need to go with vbscript approach
     
     
    Here we need to create 3 variables
     
    1. ExcelFilePath: this variable should store the excel file path
    2. ExcelSheet: this variable should store the excel sheet name
    3. TestList: This should be list of values by which values need to be filtered in excel, it should be a string type where values should be seperated by comma.
     
    Now use Run VBScript action to run the vbscript as shown below
    Dim xlApp, xlWorkbook, xlSheet
    Dim excelFilePath, stringArray
    
    ' Excel file path
    excelFilePath = "%ExcelFilePath%"
    stringArray= Split("%TestList%",",")
    
    
    
    
    ' Create Excel instance
    Set xlApp = CreateObject("Excel.Application")
    xlApp.Visible = True
    
    ' Open workbook
    Set xlWorkbook = xlApp.Workbooks.Open(excelFilePath)
    Set xlSheet =xlWorkbook.Sheets("%ExcelSheet%")
    
    ' Clear existing filters (optional)
    If xlSheet.AutoFilterMode Then
        xlSheet.AutoFilterMode = False
    End If
    
    ' Add AutoFilter to the first row (assumes header exists)
    xlSheet.Range("A1").AutoFilter
    
    ' Apply filter to Column A (1) for multiple values
    xlSheet.Range("A1").AutoFilter 1, stringArray, 7 ' 7 = xlFilterValues
    
    ' Save and close (optional)
    xlWorkbook.Save
    xlWorkbook.Close False
    xlApp.Quit
    
    ' Cleanup
    Set xlSheet = Nothing
    Set xlWorkbook = Nothing
    Set xlApp = Nothing
    
     

    Thanks & Regards,
    Nived N

    Stay connected:
    LinkedIn | YouTube | Blogs

    Was this answer helpful?
    If yes, please mark it as the solution by selecting the checkbox in the discussion thread.
    Your feedback motivates me to keep contributing. Thank you!

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 607

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard