Power Query - Filter Rows by Multiple Queries

depple

Board Regular
Joined
Sep 18, 2009
Messages
64
Hi,

First of all: I am a total newbie in Power Query, having just taken my first self-learned steps in understanding it. I have ordered books that have yet not arrived, so hopefully I will understand more then. Until so happens, please be gentle and expect limited knowledge from me on what I am actually doing :confused::

I have this filter in my query:

= Table.SelectRows(dbo_Data, each ([EAC] = "ABC") and ([ReportId] = 4))

It appears to be working fine just. However, I would like to replace the "4"-criteria with the maximum value in ReportId, so that that all old reports are filtered away.

Is this something that could be done within this formula, or do I need to build something more?
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Hi
Code:
//define max ReportId value
maxId = List.Max(dbo_Data[ReportId]),
filtered = Table.SelectRows(dbo_Data, each ([EAC] = "ABC") and ([ReportId] = maxId))
Happy New Year!
Regards,
 
Upvote 0
anvg,

Happy New Year!

Your solution worked perfectly, thank you!

In another situation I might wish to get the ReportId (or similar) from the spreadsheet, for instance through a user dropdown menu. Is there a way of fetching the ReportId filter value from the spreadsheet?

Have a nice day.

Regards,
 
Upvote 0
anvg,

Thank you.

It appears to be a little above my current level, but I will certainly look closer into it when I get a little further in the learning process.

Regards,
 
Upvote 0
If you just want to pass just 1 cell as a filter/parameter to Power Query, there is actually a very quick method to it:

Check your cell -> give it a name -> check your cell -> Power Query -> Excel Data -> From Table

This will autocreate a query with 3 steps. Delete the last 2 steps, check the (only) cell in that table - right click -> drill down.

This creates a query with an output as text value. You can use this like any other (fix) parameter in your queries/filters.
 
Upvote 0

Forum statistics

Threads
1,214,587
Messages
6,120,406
Members
448,958
Latest member
Hat4Life

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top