Power Query - run a query on demand?

lubsinka

New Member
Joined
Feb 18, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello, I am new to Power Query and need some help please. I have an excel spreadsheet Source and a second excel spreadsheet Output generated from a Power query. The power query takes the data from the Source, filters by column Change number (only displaying rows with Change number) and has additional column Comments for manual update. I did the self-referencing table query to make sure any manually entered comments would not shift during refresh.

The next thing I would like to do is upon demand/request to filter the Output table only to show me changes that are valid from next week. My end-goal is to have a button to filter by next week and another button to reset and go back to all records (initial output query to filter only data that has change number). The reason is that I want to keep record of the manually entered data in the additional columns (to simplify I only put 1 column Comments, but my actual table has several manual input tables), because different stakeholders will provide an input, which I want to remain as part of the Output table when refresh is done. I was able to create a second query using Date.IsInNextWeek which works great, but it is in a separate sheet and manually entered comment to the second query table disappears during refresh of the Output. I have been trying different solutions, and so far I was only able to create a button using a macro to refresh queries, not a button to run a query. Not sure if what I want to achieve is possible, any help would be greatly appreciated!

Additionally, I learnt I should have an identifier, so I added index column to be manually entered in the data source table (I saw I can add an index column in the power query, but did not understand if a new row is added to the Source, do we need to manually enter the next number).

Thanks for taking the time to look into it!

Best Regards,
Lubina

Below is a simplified example of what I would like to do:


Table 1 Source

IndexType of changeProduct familyChange numberValid from
1Load new BOMANo3/2/2021
2BOM changeA0013/2/2021
3BOM changeA0023/30/2021
4Load new BOMBNo3/30/2021
5BOM changeB0033/13/2021


Table 2.1 Output - filtered by Change number and sorted by family with ability to add a comment without shifting to another row.


IndexType of changeProduct familyChange numberValid fromComment
2BOM changeA0013/2/2021Implemented in production 2/18/2021
3BOM changeA0023/30/2021
5BOM changeB0033/13/2021



Table 2.2 Output - on demand Filter by Valid from "Next week" (filtered by Change number and Next week)


IndexType of changeProduct familyChange numberValid fromComment
5BOM changeB0033/13/2021In progress
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Hello, I was able to create a button to filter by next week and reset by creating a macro. I no longer need help!
 
Upvote 0

Forum statistics

Threads
1,215,758
Messages
6,126,697
Members
449,331
Latest member
smckenzie2016

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