Forum Discussion
Sale & Marketing Data Source Connect to SQL Server Error
Hi Dale,
Thanks for Respond to my post.
As per your previous reply.
The Old data source is "Access Database", Using Microsoft tool i converted to SQL DB. in that, What are column in table from old Data Source, same columns reflect in SQL aslo there is no chance to miss any columns.
Regards
Venu
- v-jiascu-msft7 years agoMicrosoft Employee
Hi Venu,
Can the SQL Query run successfully in other tools like SSMS? Can you share the file? Are the blue parts just input error?
Source = Sql.Database("DESKTOP-F125T7K", "PowerBI", [Query="SELECT #(lf) p.ProductID,#(lf)
p.Product,#(lf) p.Category,#(lf) Segment,#(lf) m.[ManufacturerID],#(lf)
IIF(p.Manufacturer='Maximus', 'VanArsdel', p.Manufacturer) Manufacturer, #(lf) p.IsCompete#(lf)
FROM [dbo].[bi_Product] p, #(lf) (#(lf) select distinct [ManufacturerID], #(lf)Manufacturer#(lf)
from [PowerBI].[dbo].[bi_Sentiment]#(lf) ) m#(lf)where m.Manufacturer = p.Manufacturer"]),Best Regards,
Dale
- venug207 years agoResolver I
I got this file from https://docs.microsoft.com/en-us/power-bi/sample-sales-and-marketing
After that i want to edit from my "Power BI Desktop", it's through error like above....
- v-jiascu-msft7 years agoMicrosoft Employee
Hi venug20,
How did get the dataset and import it into SQL Server? There should be two tables [Product] and [Sentiment]. I only changed the Server name and DB name. It works. Can you share some snapshots of the status of tables in SQL Server? Since it's a public dataset, can you share the dataset?
let Source = Sql.Database("dale2016", "fortest", [Query="SELECT #(lf) p.ProductID,#(lf) p.Product,#(lf) p.Category,#(lf) Segment,#(lf) m.[ManufacturerID],#(lf) IIF(p.Manufacturer='Maximus', 'VanArsdel', p.Manufacturer) Manufacturer, #(lf) p.IsCompete#(lf)FROM [Product] p, #(lf) (#(lf) select distinct [ManufacturerID], #(lf)Manufacturer#(lf) from [Sentiment]#(lf) ) m#(lf)where m.Manufacturer = p.Manufacturer"]), #"Renamed Columns" = Table.RenameColumns(Source, {{"Manufacturer", "Manufacturer"}, {"Category", "Category"}, {"Segment", "Segment"}, {"Product", "Product"}, {"ProductID", "ProductID"}, {"IsCompete", "IsCompeteHide"}, {"ManufacturerID", "ManufacturerID"}}), #"Changed Type" = Table.TransformColumnTypes(#"Renamed Columns", {{"Manufacturer", type text}, {"Category", type text}, {"Segment", type text}, {"Product", type text}, {"ProductID", Int64.Type}, {"IsCompeteHide", type text}, {"ManufacturerID", Int64.Type}}) in #"Changed Type"Best Regards,
Dale