Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I'm tracing my PBI queries against my SQL server and for the life of me, I can't tell why it downloads top 4096 rows from every included data table, only to perform my actual query moments later?
i.e.
This SQL:BatchCompleted happens:
select top 4096 [$Ordered].[Id], [$Ordered].[CenterId], [$Ordered].[BusinessDate], [$Ordered].[IDCash], [$Ordered].[CashDrawerName], [$Ordered].[OpenTime], [$Ordered].[OpenUser], [$Ordered].[CloseTime], [$Ordered].[CloseUser], [$Ordered].[ReportAmount], [$Ordered].[Shift_Id] from ( select [Id], [CenterId], [BusinessDate], [IDCash], [CashDrawerName], [OpenTime], [OpenUser], [CloseTime], [CloseUser], [ReportAmount], [Shift_Id] from [dbo].[CashTurns] as [$Table] ) as [$Ordered] order by [$Ordered].[Id]
Then a few events later, I see my actual query, SQL:BatchCompleted:
execute sp_executesql N'select [_].[Id] as [Id],
[_].[CenterId] as [CenterId],
[_].[BusinessDate] as [BusinessDate],
[_].[IDCash] as [IDCash],
[_].[CashDrawerName] as [Drawer Name],
[_].[OpenTime] as [Open Time],
[_].[OpenUser] as [Open User],
[_].[CloseTime] as [Close Time],
[_].[CloseUser] as [Close User],
[_].[ReportAmount] as [Amount],
[_].[Shift_Id] as [Shift_Id]
from
(
select [Id],
[CenterId],
[BusinessDate],
[IDCash],
[CashDrawerName],
[OpenTime],
[OpenUser],
[CloseTime],
[CloseUser],
[ReportAmount],
[Shift_Id]
from [dbo].[CashTurns] as [$Table]
) as [_]
where [_].[BusinessDate] = convert(datetime2, ''2018-06-04 00:00:00'') and [_].[CenterId] = 2'
Can you check whether you have given Keep Top Rows as 4096 in Query Editor?
Check this in Query Editor -> Home Tab -> Keep Rows-> Keep Top Rows. If any values mentioned theer, remove that and check again.
Thanks
Raj
I have no "Keep Rows" in my query (well, when clicked from the Query ribbon).
For all data tables (this is SQL BTW), I have some:
"Remove Columns"
"Renamed Columns"
and an advanced filter (which I guess is technically a "Keep rows...") with two simple equality comparisons, neither are "top."
could that be preview that PowerBI generates when editing the queries? If so maybe disabling background previews download would help.
or does that happen during regular refresh?
Background refresh is off, and this happens for every refresh (or initial load from a template). My SQL server is unnecessarily interrogated for > 4000 rows, for every table, just prior to performing the actual query, which seems quote incorrect...
I tried recreating the issue by slowly rebuilding my report.
When I add a filter on a date or date/time column with a literal value, it works as expected.
When I instead use a date or date/time parameter as the value for the filter on my date or date/time column, it ALWAYS retrieves 4096 rows, then actually performs the query.
I tried the same thing with a Decimal (int) type filter/parameter combination and there were no issues. It immediately queried the correct number of rows (not first 4906)...
Good catch Novox. am interetsed to understand why parameter on date behaves this way...
Thanks
Raj
I tried to open an "issue" (hoping that means "bug report") http://community.powerbi.com/t5/Issues/Using-a-date-or-date-time-parameter-as-a-filter-always-result...
I believe this is an actual Issue. Further commentary will be at http://community.powerbi.com/t5/Issues/Using-a-date-or-date-time-parameter-as-a-filter-always-result...
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |