Forum Discussion
Change/Remove Data Source
- 6 years ago
Hi Anonymous ,
In my work with PBI I have add several times to change the datasource and in my experience there are some things that went good and other messed up my reports.
Saying this you need to consider two important informations into account when making the change of datasources is that:
- Do not chan get the query name that is serving as based of your data
- Always keep the number of columns and names on the first update of the data
This two rules means that if you have a query called Query_1 with columns ID, Date, Amount you should make the transformation to keep these format, also be carefull with the dat type fo each column but that is easier to solve.
Secondly when making this type of change (from one type of datasource to another) I ussually make the new connection as if it was a new table then on the advance editor I copy the source code and other steps if needed and paste them on the previous query overwriting the source and other specific steps from that one.
On your case this would be replacing all steps from source to Changed type.
Regarding your question about the table source I'm assuming that when you refer to table is another query you just need to replace the source by the name of the other query (table) but once again since the outcome of that query is not the same as the excel file you need to delete the other 3 steps below and then reference the Group to the source.
Check below your code edited in the way I'm refering please change the name by the correct names:
let Source = NEW_TABLE_REFERENCE, #"Grouped Rows" = Table.Group(Source, {"actual_date_interval", "channel", "Project"}, {{"units_completed", each List.Sum([units_completed]), type number}, {"total_assignments", each List.Sum([total_assignments]), type number}, {"hours_worked", each List.Sum([hours_worked]), type number}}), #"Sorted Rows" = Table.Sort(#"Grouped Rows",{{"actual_date_interval", Order.Descending}}) in #"Sorted Rows"Be aware that if all the fields in the NEW_TABLE_REFERENCE don't match the ChangedType step of the previous query you will get erroros so in this case you need to have at least the fields below on your NEWTABLE:
- "actual_date_interval"
- "channel"
- "Project"
- "total_assignments"
- "hours_worked"
Right, so the the easiest way is to create a new PBIX. Connect to the Excel table as a data source. Go into Advanced Editor. Copy the first two lines and replace the two lines in your current PBIX Advanced Editor. Make sure the step names match. Is that what you are asking?
- Anonymous6 years agoNot applicable
I am good now on the solution provided. Still I appreciate the response and thank you! 🙂