Automating a report with pre-existing tables and charts

%3CLINGO-SUB%20id%3D%22lingo-sub-2971283%22%20slang%3D%22en-US%22%3EAutomating%20a%20report%20with%20pre-existing%20tables%20and%20charts%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2971283%22%20slang%3D%22en-US%22%3E%3CP%3EPosting%20this%20again%2C%20this%20time%20with%20examples%20to%20hopefully%20help%20you%20all%20answer%20the%20question.%20I%20will%20attach%20two%20excels.%20The%20first%20one%20is%20an%20example%20of%20what%20I%20fill%20out%20every%20so%20often%20(Labelled%3A%20Template%20for%20help).%20I%20typically%20take%20the%20raw%20data%20(Example%20also%20attached%2C%20Labelled%3A%20Example%20raw%20data%20for%20help)%2C%20and%20fill%20in%20all%20of%20the%20blank%20spaces%20on%20the%20template.%20The%20template%20includes%20some%20cells%20that%20never%20change%20(Row%209%2C%20for%20instance%2C%20will%20always%20stay%20the%20same%20as%20it%20is%20referencing%20prior%20year%20spent).%20I%20included%201%20row%20from%20the%20raw%20data%20as%20an%20example%2C%20but%20there%20are%20typically%2030%2C000%2B%20lines%20of%20data.%20The%20raw%20data%20can%20be%20filtered%20by%20different%20numbers.%20So%20each%20building%2C%20office%2C%20person%2C%20card%20etc.%20has%20a%20number%20assigned%20to%20it%2C%20and%20you%20can%20filter%20by%20'Building%2C%20Office%20%23%2C%20Personnel%20%23%26nbsp%3B%20and%20a%20couple%20of%20other%20identifying%20numbers%20to%20get%20to%20the%20rows%20(Or%20lines)%20that%20you%20are%20needing%20to%20get%20the%20numbers%20you%20need%20for%20the%20Template.%20I%20have%20a%20pivot%20table%20that%20usually%20pulls%20only%20the%20info%20I%20need%2C%20for%20ease%20of%20finding%20it%2C%20but%20that%20still%20includes%20quite%20a%20bit%20of%20research%20and%20adding%20numerous%20numbers%20together.%20I%20am%20wanting%20to%20find%20a%20way%20to%20automate%20this%2C%20some%20way%20that%20the%20'Template'%20can%20be%20automatically%20filled%20out%20(updated%20when%20a%20new%20report%20is%20pulled)%2C%20but%20keep%20the%20same%20look%20and%20template%20of%20the%20Template%20attached%2C%20graph%20and%20all.%20To%20add%20more%20information%2C%20each%20table%20on%20the%20Template%20is%20different.%20So%20the%20top%20one%20shows%20the%20total%20spent%20by%20each%20office%2C%20using%20the%20Office%20%23.%20The%20table%20to%20the%20right%20is%20what%20each%20Account%20(Or%20person%20for%20instance)%20spent%2C%20and%20the%20table%20on%20the%20bottom%20shows%20what%20each%20office%20spent%2C%20but%20broken%20apart%20by%20which%20card%20they%20were%20using.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20any%20possible%20way%20for%20this%20to%20be%20done%3F%20I%20think%20I%20could%20possibly%20completely%20recreate%20the%20Template%2C%20using%20PowerQuery%2C%20but%20to%20get%20it%20to%20match%20exactly%20seems%20like%20an%20actual%20struggle.%20Is%20there%20a%20better%20way%20that%20I%20don't%20know%20about%3F%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2971283%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EBI%20%26amp%3B%20Data%20Analysis%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2972126%22%20slang%3D%22en-US%22%3ERe%3A%20Automating%20a%20report%20with%20pre-existing%20tables%20and%20charts%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2972126%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1220173%22%20target%3D%22_blank%22%3E%40Stinky111%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20guess%20not%20exactly%20the%20same%20but%20close%20to%20it%20template%20could%20be%20generated%20using%20Power%20Query%2C%20but%20that%20all%20depend%20on%20concrete%20data.%20How%20to%20define%20parameters%2C%20now%20you%20have%206%20offices%2C%20could%20it%20be%2060%20of%20them%2C%20etc.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2972252%22%20slang%3D%22en-US%22%3ERe%3A%20Automating%20a%20report%20with%20pre-existing%20tables%20and%20charts%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2972252%22%20slang%3D%22en-US%22%3EThe%20template%20will%20always%20stay%20the%20same.%20As%20in%20always%20the%20same%20offices%20and%20stuff.%20Only%20the%20blank%20cells%20where%20the%20%24%20amounts%20go%20will%20ever%20change.%20Unless%20we%20get%20a%20new%20office%20in%20the%20future%2C%20which%20I%20will%20be%20able%20to%20handle%20at%20that%20time.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2972438%22%20slang%3D%22en-US%22%3ERe%3A%20Automating%20a%20report%20with%20pre-existing%20tables%20and%20charts%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2972438%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1220173%22%20target%3D%22_blank%22%3E%40Stinky111%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20so%20that's%20mainly%20how%20to%20format%20structured%20tables%20returned%20by%20Power%20Query.%20For%20that%20you%20actually%20don't%20need%20Power%20Query%2C%20you%20may%20transform%20ranges%20which%20are%20now%20in%20the%20template%20into%20structured%20table%20and%20play%20with%20formatting.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENext%20step%20is%20how%20to%20transform%20raw%20data%20by%20Power%20Query.%20Most%20probably%20that's%20possible%2C%20but%20without%20concrete%20sample%20with%20all%20details%20it's%20hard%20to%20say%20something%20more%20concrete.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Posting this again, this time with examples to hopefully help you all answer the question. I will attach two excels. The first one is an example of what I fill out every so often (Labelled: Template for help). I typically take the raw data (Example also attached, Labelled: Example raw data for help), and fill in all of the blank spaces on the template. The template includes some cells that never change (Row 9, for instance, will always stay the same as it is referencing prior year spent). I included 1 row from the raw data as an example, but there are typically 30,000+ lines of data. The raw data can be filtered by different numbers. So each building, office, person, card etc. has a number assigned to it, and you can filter by 'Building, Office #, Personnel #  and a couple of other identifying numbers to get to the rows (Or lines) that you are needing to get the numbers you need for the Template. I have a pivot table that usually pulls only the info I need, for ease of finding it, but that still includes quite a bit of research and adding numerous numbers together. I am wanting to find a way to automate this, some way that the 'Template' can be automatically filled out (updated when a new report is pulled), but keep the same look and template of the Template attached, graph and all. To add more information, each table on the Template is different. So the top one shows the total spent by each office, using the Office #. The table to the right is what each Account (Or person for instance) spent, and the table on the bottom shows what each office spent, but broken apart by which card they were using. 

 

Is there any possible way for this to be done? I think I could possibly completely recreate the Template, using PowerQuery, but to get it to match exactly seems like an actual struggle. Is there a better way that I don't know about? 

7 Replies

@Stinky111 

I guess not exactly the same but close to it template could be generated using Power Query, but that all depend on concrete data. How to define parameters, now you have 6 offices, could it be 60 of them, etc.

The template will always stay the same. As in always the same offices and stuff. Only the blank cells where the $ amounts go will ever change. Unless we get a new office in the future, which I will be able to handle at that time.

@Stinky111 

If so that's mainly how to format structured tables returned by Power Query. For that you actually don't need Power Query, you may transform ranges which are now in the template into structured table and play with formatting.

 

Next step is how to transform raw data by Power Query. Most probably that's possible, but without concrete sample with all details it's hard to say something more concrete.

I gotcha! I do not know how to convert the current tables on the template into a structured table, but I will be finding a YouTube video to help! Lol. I wish I could personally email you or someone else that’s trusted the actual copies of the Template and the raw data. It would clear up a lot of confusion. I just don’t trust putting actual info onto the web.

@Stinky111 

Formatting of current data as the table is only to play with design, actually you will need to format tables returned by Power Query. If you see that new design meets your need, you re-apply it to Power Query tables. To illustrate feasibility I converted one of ranges to table

image.png

Power Query requires to work if not with actual when with more or less realistic data. Unfortunately I can't take such project, lot of other work.

I completely understand! Thank you for all of your help and advice, it is very appreciated!