Forum Discussion
Get Limited data in Power BI
- 8 years ago
You can change the source from import without breaking you reports as long as the name and column list stay the same.
This is an example odbc source from the advanced editor
let Source = Odbc.DataSource("dsn=WideWorldImporters", [HierarchicalNavigation=true]), WideWorldImporters_Database = Source{[Name="WideWorldImporters",Kind="Database"]}[Data], Website_Schema = WideWorldImporters_Database{[Name="Website",Kind="Schema"]}[Data], Customers_View = Website_Schema{[Name="Customers",Kind="View"]}[Data] in Customers_ViewYou can change it manually in the advanced editor to something like this. Changing the query to limit to relevant rows.
let
Source = Odbc.Query("dsn=WideWorldImporters", "SELECT TOP (1000) [CustomerID]#(lf) ,[CustomerName]#(lf) ,[CustomerCategoryName]#(lf) ,[PrimaryContact]#(lf) ,[AlternateContact]#(lf) ,[PhoneNumber]#(lf) ,[FaxNumber]#(lf) ,[BuyingGroupName]#(lf) ,[WebsiteURL]#(lf) ,[DeliveryMethod]#(lf) ,[CityName]#(lf) ,[DeliveryLocation]#(lf) ,[DeliveryRun]#(lf) ,[RunPosition]#(lf) FROM [WideWorldImporters].[Website].[Customers]#(lf) order by [CustomerID] desc")
in
SourceYou can click the settings cog icon next to Source and use the advanced options to add the select and finally delete the navigation step.
If you have 30million rows you may want to aggregate the data and limit the columns in the select and fix the report if this changes things. It's not going to be the best performing powerbi doc if you have to load that many rows on every refresh.
You can change the source from import without breaking you reports as long as the name and column list stay the same.
This is an example odbc source from the advanced editor
let
Source = Odbc.DataSource("dsn=WideWorldImporters", [HierarchicalNavigation=true]),
WideWorldImporters_Database = Source{[Name="WideWorldImporters",Kind="Database"]}[Data],
Website_Schema = WideWorldImporters_Database{[Name="Website",Kind="Schema"]}[Data],
Customers_View = Website_Schema{[Name="Customers",Kind="View"]}[Data]
in
Customers_ViewYou can change it manually in the advanced editor to something like this. Changing the query to limit to relevant rows.
let
Source = Odbc.Query("dsn=WideWorldImporters", "SELECT TOP (1000) [CustomerID]#(lf) ,[CustomerName]#(lf) ,[CustomerCategoryName]#(lf) ,[PrimaryContact]#(lf) ,[AlternateContact]#(lf) ,[PhoneNumber]#(lf) ,[FaxNumber]#(lf) ,[BuyingGroupName]#(lf) ,[WebsiteURL]#(lf) ,[DeliveryMethod]#(lf) ,[CityName]#(lf) ,[DeliveryLocation]#(lf) ,[DeliveryRun]#(lf) ,[RunPosition]#(lf) FROM [WideWorldImporters].[Website].[Customers]#(lf) order by [CustomerID] desc")
in
Source
You can click the settings cog icon next to Source and use the advanced options to add the select and finally delete the navigation step.
If you have 30million rows you may want to aggregate the data and limit the columns in the select and fix the report if this changes things. It's not going to be the best performing powerbi doc if you have to load that many rows on every refresh.
Thank you so much. That works!