- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Filter function in Power Query Editor
Hi everyone,
I'm trying to filter a table in Power Query Editor by IDs that are in "Stage 3" but also show me their values from their previous stages.
E.g.
Initial table
ID | Stage | Score |
001 | 1 | 50% |
001 | 2 | 30% |
001 | 3 | 70% |
002 | 1 | 15% |
002 | 2 | 27% |
003 | 1 | 10% |
003 | 2 | 66% |
003 | 3 | 30% |
004 | 1 | 10% |
005 | 1 | 26% |
005 | 2 | 37% |
Filtered table
ID | Stage | Score |
001 | 1 | 50% |
001 | 2 | 30% |
001 | 3 | 70% |
003 | 1 | 10% |
003 | 2 | 66% |
003 | 3 | 30% |
I've tried but I only get values in Stage 3. Does anyone know how I can do it?
Thank you so much in advance,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Diego11 ,
Before:
After:
Here the code in Power Query M that you can paste into the advanced editor (if you do not know, how to exactly do this, please check out this quick walkthrough)
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Zc6xDQAgCATAXUjsLBAEhzHuv4ZixGAsvrnweXoHxAIZLIIJRnahFX6EV9oVOq0iUXaaC/sNRrEb1Sj8bNWvJUdIo+wPbWtM", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, #"Stage " = _t, Score = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"Stage ", Int64.Type}, {"Score", Percentage.Type}}), #"Filtered Rows" = Table.SelectRows(#"Changed Type", each ([#"Stage "] = 3)), #"Merged Queries" = Table.NestedJoin(#"Changed Type", {"ID"}, #"Filtered Rows", {"ID"}, "Filtered Rows", JoinKind.Inner), #"Removed Columns" = Table.RemoveColumns(#"Merged Queries",{"Filtered Rows"}) in #"Removed Columns"
Let me know, if this helps 🙂
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/
Did I answer your question❓➡️ Please, mark my post as a solution ✔️ |
Also happily accepting Kudos 🙂 |
Feel free to connect with me on LinkedIn! | |
#proudtobeasuperuser | |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Diego11 ,
Before:
After:
Here the code in Power Query M that you can paste into the advanced editor (if you do not know, how to exactly do this, please check out this quick walkthrough)
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Zc6xDQAgCATAXUjsLBAEhzHuv4ZixGAsvrnweXoHxAIZLIIJRnahFX6EV9oVOq0iUXaaC/sNRrEb1Sj8bNWvJUdIo+wPbWtM", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, #"Stage " = _t, Score = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"Stage ", Int64.Type}, {"Score", Percentage.Type}}), #"Filtered Rows" = Table.SelectRows(#"Changed Type", each ([#"Stage "] = 3)), #"Merged Queries" = Table.NestedJoin(#"Changed Type", {"ID"}, #"Filtered Rows", {"ID"}, "Filtered Rows", JoinKind.Inner), #"Removed Columns" = Table.RemoveColumns(#"Merged Queries",{"Filtered Rows"}) in #"Removed Columns"
Let me know, if this helps 🙂
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/
Did I answer your question❓➡️ Please, mark my post as a solution ✔️ |
Also happily accepting Kudos 🙂 |
Feel free to connect with me on LinkedIn! | |
#proudtobeasuperuser | |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi Tom.
It worked. Thank you very much for your help 🙂.

Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Power BI Monthly Update - February 2025
Check out the February 2025 Power BI update to learn about new features.

Subject | Author | Posted | |
---|---|---|---|
03-02-2024 03:37 AM | |||
03-06-2023 07:17 AM | |||
06-24-2023 12:11 PM | |||
08-03-2023 01:19 AM | |||
Anonymous
| 04-27-2021 05:59 AM |
User | Count |
---|---|
29 | |
26 | |
23 | |
13 | |
10 |
User | Count |
---|---|
24 | |
21 | |
17 | |
11 | |
9 |