SOLVED

Power Query Refresh issue

%3CLINGO-SUB%20id%3D%22lingo-sub-3502976%22%20slang%3D%22en-US%22%3EPower%20Query%20Refresh%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3502976%22%20slang%3D%22en-US%22%3E%3CP%3EHello!%3C%2FP%3E%3CP%3EI%20just%20start%20learning%20Power%20Query%20and%20I%20could%20not%20figure%20out%20what%20I%20did%20wrong...%3C%2FP%3E%3CP%3EI%20created%20a%20test%20file%20with%20two%20worksheets.%20Followed%20a%20step%20by%20step%20instructions%20and%20I%20created%20a%20query%20table.%20I%20made%20a%20change%20on%20the%20source%20data%2C%20save%20then%20refresh%2C%20I%20got%20below%20result.%20If%20someone%20can%20help%20me%2C%20I%20truly%20appreciate!%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Yuko_Tarby255_0-1655175987198.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Yuko_Tarby255_0-1655175987198.png%22%20style%3D%22width%3A%20105px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Yuko_Tarby255_0-1655175987198.png%22%20style%3D%22width%3A%20105px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Yuko_Tarby255_0-1655175987198.png%22%20style%3D%22width%3A%20105px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Yuko_Tarby255_0-1655175987198.png%22%20style%3D%22width%3A%20105px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Yuko_Tarby255_0-1655175987198.png%22%20style%3D%22width%3A%20105px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Yuko_Tarby255_0-1655175987198.png%22%20style%3D%22width%3A%20105px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Yuko_Tarby255_0-1655175987198.png%22%20style%3D%22width%3A%20105px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Yuko_Tarby255_0-1655175987198.png%22%20style%3D%22width%3A%20105px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Yuko_Tarby255_0-1655175987198.png%22%20style%3D%22width%3A%20105px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Yuko_Tarby255_0-1655175987198.png%22%20style%3D%22width%3A%20105px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Yuko_Tarby255_0-1655175987198.png%22%20style%3D%22width%3A%20105px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F380055iFD22326D913B3671%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Yuko_Tarby255_0-1655175987198.png%22%20alt%3D%22Yuko_Tarby255_0-1655175987198.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3502976%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3503126%22%20slang%3D%22en-US%22%3ERe%3A%20Power%20Query%20Refresh%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3503126%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1423225%22%20target%3D%22_blank%22%3E%40Yuko_Tarby255%3C%2FA%3E%26nbsp%3BThat's%20difficult%20to%20answer%20without%20looking%20at%20the%20date%20and%20the%20query%20itself.%20Since%20it's%20just%20a%20test%20file%2C%20you%20can%20perhaps%20share%20it%20via%20Onedrive%2C%20Dropbox%20are%20similar.%20Always%20much%20easier%20to%20work%20with%20a%20file%20on%20hand.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3507734%22%20slang%3D%22en-US%22%3ERe%3A%20Power%20Query%20Refresh%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3507734%22%20slang%3D%22en-US%22%3EWould%20you%20please%20take%20a%20look%3F%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2F1drv.ms%2Fx%2Fs!AmXz2i0hTvTlgew0ZFxFUkEuTpGZ_w%3Fe%3DNkE4Ps%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2F1drv.ms%2Fx%2Fs!AmXz2i0hTvTlgew0ZFxFUkEuTpGZ_w%3Fe%3DNkE4Ps%3C%2FA%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3508507%22%20slang%3D%22en-US%22%3ERe%3A%20Power%20Query%20Refresh%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3508507%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1423225%22%20target%3D%22_blank%22%3E%40Yuko_Tarby255%3C%2FA%3E%26nbsp%3BThanks.%20Can't%20tell%20what%20instructions%20you%20followed%20but%20must%20have%20missed%20a%20small%20step%20as%20your%20query%20connect%20to%20all%20%22items%22%20in%20the%20workbook.%20That%20is%2C%20the%20sheets%20for%20Jan%20and%20Feb%2C%20a%20hidden%20defined%20named%2C%20the%20output%20of%20the%20query%20itself%20and%20the%20sheet%20in%20which%20the%20output%20is%20stored.%20It%20creates%20a%20table%20for%20each%20of%20these%20%22items%22%2C%20and%20you%20expand%20all%20of%20them%20upon%20each%20refresh.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%2C%20I%20guess%20the%20first%20time%20you%20ran%20the%20query%20the%20workbook%20had%20only%20two%20sheets%20(Jan%20and%20Feb)%20and%20PQ%20combined%20%3CU%3Eall%20it%20found%3C%2FU%3E%20and%20loaded%20the%20result%20back%20to%20the%20table%20called%20TOTAL_COUNT%20in%20the%20sheet%20TOTAL%20COUNT%20and%20in%20the%20background%20it%20created%20a%20hidden%20defined%20name.%20You%20then%20changed%20some%20data%20in%20the%20Jan%20or%20Feb%20sheets%2C%20and%20refreshed%20the%20query.%20At%20that%20point%20PQ%20combined%20again%20%3CU%3Eall%20it%20found%3C%2FU%3E%26nbsp%3Bin%20the%20workbook.%20So%20%3CU%3Enot%20only%3C%2FU%3E%20Jan%20and%20Feb.%20The%20Expand%20step%20combines%20all%20tables%20you%20see%20in%20the%20picture%20below.%20Your%20TOTAL_COUNT%20table%20will%20grow%20bigger%20with%20every%20time%20you%20refresh%20the%20query%20as%20it%20will%20include%20a%20duplicate%20of%20itself%20plus%20all%20other%20items.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot%202022-06-15%20at%2005.41.44.png%22%20style%3D%22width%3A%20544px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%202022-06-15%20at%2005.41.44.png%22%20style%3D%22width%3A%20544px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%202022-06-15%20at%2005.41.44.png%22%20style%3D%22width%3A%20544px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%202022-06-15%20at%2005.41.44.png%22%20style%3D%22width%3A%20544px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%202022-06-15%20at%2005.41.44.png%22%20style%3D%22width%3A%20544px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%202022-06-15%20at%2005.41.44.png%22%20style%3D%22width%3A%20544px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F380412i8E85D05387CFFB6B%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Screenshot%202022-06-15%20at%2005.41.44.png%22%20alt%3D%22Screenshot%202022-06-15%20at%2005.41.44.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3EBefore%3C%2FSTRONG%3E%20you%20delete%20all%20columns%20except%20the%20%22Data%22%20column%20and%20then%20expand%2C%20you%20need%20to%20tell%20PQ%20which%20items%20you%20want%20to%20work%20with.%20I%20guess%20in%20your%20case%20that's%20Jan%20and%20Feb.%20Then%20you%20should%2C%20for%20instance%2C%20filter%20out%20all%20Items%20that%20contain%20the%20word%20TOTAL%20to%20end%20up%20with%20this%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot%202022-06-15%20at%2005.58.53.png%22%20style%3D%22width%3A%20592px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%202022-06-15%20at%2005.58.53.png%22%20style%3D%22width%3A%20592px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%202022-06-15%20at%2005.58.53.png%22%20style%3D%22width%3A%20592px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%202022-06-15%20at%2005.58.53.png%22%20style%3D%22width%3A%20592px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%202022-06-15%20at%2005.58.53.png%22%20style%3D%22width%3A%20592px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%202022-06-15%20at%2005.58.53.png%22%20style%3D%22width%3A%20592px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F380413i3B31556A8C15036E%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Screenshot%202022-06-15%20at%2005.58.53.png%22%20alt%3D%22Screenshot%202022-06-15%20at%2005.58.53.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3ENow%2C%20the%20rest%20of%20the%20query%20will%20only%20work%20with%20these%20two%20tables%20and%20you%20will%20not%20duplicate%20the%20output%20from%20a%20previous%20refresh.%26nbsp%3BAnd%20later%20on%20you%20probably%20add%20Mar%2C%20Apr%2C%20May%20etc.%20PQ%20will%20then%20includes%20these%20as%20well%20but%20NOT%20the%20items%20that%20contain%20the%20word%20TOTAL.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3513616%22%20slang%3D%22en-US%22%3ERe%3A%20Power%20Query%20Refresh%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3513616%22%20slang%3D%22en-US%22%3EHi%20Riny%2C%3CBR%20%2F%3EThank%20you%20so%20much%20look%20into%20this!!%20I%20am%20still%20struggling%20so%2C%20I%20created%20data%20file%20and%20PQ%20file%20separately%20then%20it%20worked.%20However%2C%20my%20goal%20is%20use%20one%20spreadsheet%20to%20do%20all.%20I%20do%20understand%20what%20you%20explained%20but%20would%20you%20please%20tell%20me%20how%20to%20lock%20the%20item%3F(Key%20icon).%20Thank%20you%20again.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3513907%22%20slang%3D%22en-US%22%3ERe%3A%20Power%20Query%20Refresh%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3513907%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1423225%22%20target%3D%22_blank%22%3E%40Yuko_Tarby255%3C%2FA%3E%26nbsp%3BSure%2C%20you%20can%20have%20all%20in%20one%20file%2C%20but%20In%20the%20step%20%3CSTRONG%3E%3CU%3Ebefore%3C%2FU%3E%3C%2FSTRONG%3E%20you%20%22remove%20other%20columns%22%20you%20need%20to%20filter%20the%20%3CEM%3EItem%3C%2FEM%3E%20column.%20It%20works%20similar%20to%20how%20you%20filter%20in%20Excel.%20Press%20the%20downward%20pointing%20triangle%20in%20the%20column%20header%20and%20define%20the%20filter%20you%20need.%20In%20this%20case%20I%20used%20%22does%20not%20contain%20TOTAL%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBy%20the%20way%2C%20I've%20been%20experimenting%20with%20PQ%20in%20Excel%20for%20the%20Mac%20when%20I%20looked%20at%20your%20file.%20In%20the%20PC%20version%20the%20pictures%20are%20slightly%20different%20but%20the%20principle%20is%20the%20same.%20So%20it%20will%20not%20look%20exactly%20the%20same%20on%20your%20computer.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20might%20find%20the%20link%20below%20useful%20in%20getting%20up%20to%20speed%20with%20PQ%20basics.%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fexceloffthegrid.com%2Fpower-query-introduction%2F%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fexceloffthegrid.com%2Fpower-query-introduction%2F%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3518444%22%20slang%3D%22en-US%22%3ERe%3A%20Power%20Query%20Refresh%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3518444%22%20slang%3D%22en-US%22%3EHi%20Riny%2C%3CBR%20%2F%3EOMG%20IT%20WORKED!!!%20I%20could%20change%20the%20source%20data%20or%20adding%20another%20worksheet%20and%20ALL%20WORKED!%20Thank%20you%20for%20being%20patient%20with%20me.%20I%20bookmarked%20the%20link%20and%20will%20learn%20more!%20THANK%20YOU!!!%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E
New Contributor

Hello!

I just start learning Power Query and I could not figure out what I did wrong...

I created a test file with two worksheets. Followed a step by step instructions and I created a query table. I made a change on the source data, save then refresh, I got below result. If someone can help me, I truly appreciate!  

 

Yuko_Tarby255_0-1655175987198.png

 

6 Replies

@Yuko_Tarby255 That's difficult to answer without looking at the date and the query itself. Since it's just a test file, you can perhaps share it via Onedrive, Dropbox are similar. Always much easier to work with a file on hand.

@Yuko_Tarby255 Thanks. Can't tell what instructions you followed but must have missed a small step as your query connect to all "items" in the workbook. That is, the sheets for Jan and Feb, a hidden defined named, the output of the query itself and the sheet in which the output is stored. It creates a table for each of these "items", and you expand all of them upon each refresh.

 

So, I guess the first time you ran the query the workbook had only two sheets (Jan and Feb) and PQ combined all it found and loaded the result back to the table called TOTAL_COUNT in the sheet TOTAL COUNT and in the background it created a hidden defined name. You then changed some data in the Jan or Feb sheets, and refreshed the query. At that point PQ combined again all it found in the workbook. So not only Jan and Feb. The Expand step combines all tables you see in the picture below. Your TOTAL_COUNT table will grow bigger with every time you refresh the query as it will include a duplicate of itself plus all other items.

Screenshot 2022-06-15 at 05.41.44.png

Before you delete all columns except the "Data" column and then expand, you need to tell PQ which items you want to work with. I guess in your case that's Jan and Feb. Then you should, for instance, filter out all Items that contain the word TOTAL to end up with this:

Screenshot 2022-06-15 at 05.58.53.png

Now, the rest of the query will only work with these two tables and you will not duplicate the output from a previous refresh. And later on you probably add Mar, Apr, May etc. PQ will then includes these as well but NOT the items that contain the word TOTAL.

 

 

 

Hi Riny,
Thank you so much look into this!! I am still struggling so, I created data file and PQ file separately then it worked. However, my goal is use one spreadsheet to do all. I do understand what you explained but would you please tell me how to lock the item?(Key icon). Thank you again.
best response confirmed by Yuko_Tarby255 (New Contributor)
Solution

@Yuko_Tarby255 Sure, you can have all in one file, but In the step before you "remove other columns" you need to filter the Item column. It works similar to how you filter in Excel. Press the downward pointing triangle in the column header and define the filter you need. In this case I used "does not contain TOTAL"

 

By the way, I've been experimenting with PQ in Excel for the Mac when I looked at your file. In the PC version the pictures are slightly different but the principle is the same. So it will not look exactly the same on your computer.

 

You might find the link below useful in getting up to speed with PQ basics.

https://exceloffthegrid.com/power-query-introduction/ 

Hi Riny,
OMG IT WORKED!!! I could change the source data or adding another worksheet and ALL WORKED! Thank you for being patient with me. I bookmarked the link and will learn more! THANK YOU!!!