SOLVED
Home

Sorting problem with imported data from query

%3CLINGO-SUB%20id%3D%22lingo-sub-888436%22%20slang%3D%22en-US%22%3ERe%3A%20Sorting%20problem%20with%20imported%20data%20from%20query%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-888436%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F418596%22%20target%3D%22_blank%22%3E%40DenisL%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETable%20returned%20by%20Power%20Query%20and%20manually%20added%20columns%20are%20not%20synced.%20You%20may%20link%20them%20by%20some%20field%2C%20if%20exists%2C%20e.g.%20Task%20ID.%20Or%20move%20your%20calculations%20into%20Power%20Query%20-%20it%20looks%20like%20column%20Time%20Left%20could%20be%20added%20within%20Power%20Query%20and%20returned%20to%20Excel%20together%20with%20main%20table.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-888489%22%20slang%3D%22en-US%22%3ERe%3A%20Sorting%20problem%20with%20imported%20data%20from%20query%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-888489%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20Sergei!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20for%20the%20answer.%3C%2FP%3E%3CP%3EI%20do%20have%20a%20column%20to%20use%20as%20linkage.%20I%20am%20just%20not%20sure%20how%20to%20do%20that.%20Do%20you%20have%20a%20tutoria%20link%20at%20hand%20that%20I%20could%20maybe%20use%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20will%20try%20the%202nd%20solution%20as%20well%20and%20see%20how%20far%20I%20can%20get%20with%20it.%3C%2FP%3E%3CP%3EThanks%20again!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-888501%22%20slang%3D%22en-US%22%3ERe%3A%20Sorting%20problem%20with%20imported%20data%20from%20query%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-888501%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F418596%22%20target%3D%22_blank%22%3E%40DenisL%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESecond%20option%20with%20Power%20Query%20is%20much%20more%20preferable.%20If%20with%20ID%20you%20may%20add%20values%20from%20one%20table%20into%20another%20using%20INDEX%2FMATCH%20or%20VLOOKUP%20based%20on%20ID.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-888689%22%20slang%3D%22en-US%22%3ERe%3A%20Sorting%20problem%20with%20imported%20data%20from%20query%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-888689%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%202nd%20solution%20works%20amazingly!%20Thank%20you!%20I%20have%20almost%20finished%20my%20whole%20data%20set.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-888901%22%20slang%3D%22en-US%22%3ERe%3A%20Sorting%20problem%20with%20imported%20data%20from%20query%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-888901%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F418596%22%20target%3D%22_blank%22%3E%40DenisL%3C%2FA%3E%26nbsp%3B%2C%20you%20are%20welcome%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-888410%22%20slang%3D%22en-US%22%3ESorting%20problem%20with%20imported%20data%20from%20query%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-888410%22%20slang%3D%22en-US%22%3E%3CP%3EHello!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20difficulties%20sorting%20the%20data%20in%20Excel.%20In%20the%20attached%20picture%2C%20there%20are%202%20columns%20to%20the%20left%20and%202%20to%20the%20right.%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20ones%20to%20the%20left%20are%20imported%20via%20a%20query%20from%20an%20SQL%20server.%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20ones%20to%20the%20right%20are%20with%20formulas%20inserted%20by%20me.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20problem%3A%20I%20cannot%20sort%20the%20data%20set%20based%20on%20the%20results%20from%20the%20formulas.%26nbsp%3B%3C%2FP%3E%3CP%3EExample%3A%20To%20sort%20the%20whole%20data%20set%20based%20on%20%22Time%20Left%22%20column.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20would%20like%20to%20sort%20the%20dataset%20based%20on%20the%20results%20of%20the%20formulas%2C%20but%20still%20have%20the%20query%20active%20and%20downloading%20data%20when%20refreshed.%26nbsp%3B%3C%2FP%3E%3CP%3EI%20know%20that%20I%20could%20convert%20the%20whole%20query%20range%2C%20but%20this%20is%20not%20what%20I%20want.%20The%20data%20needs%20to%20be%20updated%20continuously.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20that%20I%20managed%20to%20explain%20the%20problem%20as%20clearly%20as%20possible.%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20in%20advance%20for%20your%20help!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBest%20regards%2C%26nbsp%3B%3C%2FP%3E%3CP%3EDenis%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-888410%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EQuery%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
DenisL
New Contributor

Hello!

 

I have difficulties sorting the data in Excel. In the attached picture, there are 2 columns to the left and 2 to the right. 

The ones to the left are imported via a query from an SQL server. 

The ones to the right are with formulas inserted by me. 

 

The problem: I cannot sort the data set based on the results from the formulas. 

Example: To sort the whole data set based on "Time Left" column. 

 

I would like to sort the dataset based on the results of the formulas, but still have the query active and downloading data when refreshed. 

I know that I could convert the whole query range, but this is not what I want. The data needs to be updated continuously. 

 

Hope that I managed to explain the problem as clearly as possible. 

Thank you in advance for your help!

 

Best regards, 

Denis

5 Replies
Solution

@DenisL 

Table returned by Power Query and manually added columns are not synced. You may link them by some field, if exists, e.g. Task ID. Or move your calculations into Power Query - it looks like column Time Left could be added within Power Query and returned to Excel together with main table.

Hello Sergei!

 

Thank you for the answer.

I do have a column to use as linkage. I am just not sure how to do that. Do you have a tutoria link at hand that I could maybe use? 

 

I will try the 2nd solution as well and see how far I can get with it.

Thanks again!

@DenisL 

Second option with Power Query is much more preferable. If with ID you may add values from one table into another using INDEX/MATCH or VLOOKUP based on ID.

@Sergei Baklan 

The 2nd solution works amazingly! Thank you! I have almost finished my whole data set.

@DenisL , you are welcome

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
46 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
29 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
13 Replies