How to configure incremental refresh for table that doesn't show native query? - powerbi

I have a large fact table.
Until the last step where I merge it with another table, I can see native query. Only after the merge it stops showing the native query.
This mean that if I configure incremental refresh on this table, then it will still perform a full load. Because the pre-requisite for incremental refresh is that it should show native query.
What is the solution/workaround to this? For example: Say I remove the last (merge) step, and now it shows me native query and so say I configure incremental refresh for this. Then, can I create a new table that references this table and perform the merge operation using this table so that all the steps prior to merge (referenced from original table) happen as incremental load, where as merge happens non-incrementally. Is this possible? I think not because reference doesn't mean reuse and so it will fire a fresh query for the new table (including all steps from the referenced source table).

Related

How to perform incremental refresh on merged table?

I have 2 tables in Power query editor.
I want to merge them and implement incremental load on merged table.
Following is my plan:
Merge both tables into a new table (Table3)
Disable refresh and disable load for both tables.
How to configure Incremental refresh on Table3?
Do I need to also configure Incremental refresh on Table1 and Table2?
So technically- will each table get incrementally loaded and then merge. Or will entire data be merged and then incrementally loaded?
For this to work you need to, in simple terms:
Create your limiting parameters RangeStart and RangeEnd
Set up a filter on applicable date columns using RangeStart and RangeEnd parameters for your subqueries Table 1 and Table 2 (this controls data ingestion)
Set up the same type logic for the applicable date column in Table 3 (this controls data deletion)
Configure incremental refresh time logic
For it to be actually efficient you also need to make sure:
Data is transactional in nature
Both subqueries are foldable and from the same data source
The resulting table is foldable
If the queries are not foldable, it will require a full data load and subsequent filter anyway, removing the benefits of incremental refresh.
There exists a nice write-up of this in the Power BI Community pages that details how you would go about setting this up for a header/detail table join.

Schedule the creation a partitioned table overwriting an existing table in BigQuery GCP

Yesterday I scheduled daily the overwriting of a table. The new table will be partitioned as well as the overwritten one... It did not run at the corresponding time, nor gave an error... It just did not started.
My feeling is that it has to be with the partitioning option. To mention that the casting of the field date_formatted that will be used as partition field works fine.
As far as I know, when scheduling a query you can't use the create or replace table T partitioned by column C as select...
You starts from the select... clause, as shows in the image, and I don't know if the problem comes from here.
PS: I had no troubles scheduling the appending to a partitioned by day table with this same procedure.
the destination table is in the same dataset.
if the very same query is scheduled to deliver the results in a table with the same name, but in a different dataset (located in the same project), it works.
by the way, the input table and the output table never were the same.

PowerBI Query Performance

I have a PowerBI report that has a few different pages display different visuals. The report uses the same table of data (lets call it Jobs).
The previous author of this report has created two queries in the data section that read off this base table of data, but apply different transformations and filters to the underlying data. Then, the visuals use either of these models to display their data. For example, the first one applies a filter to exclude certain columns based off a status field and the other applies a different filter, and performs transformations on some of the columns
When I manually refresh the report, it looks like the report is retrieving data for both of these queries, even though the base data is the same. Since the dataset is quite large, I am worried that this report has been built inefficiently but I am not sure if there is a better way of doing this.
TL;DR; The Source and Navigation of both of queries is exactly the same - is this retrieving the data twice and causing my report to be inefficient, and if so, what is the approrpiate way to achieve what I am trying to do?
PowerBi will try to parallelize as much as possible. If you have two queries that read from the same table then two queries will be executed.
To avoid this you can:
create a query which only gets the necessary data from the table.
Set this table not to be loaded in the model (toggle "Enable Load")
Every other table that starts from this table won't be a clone of this but will reference it.
In this way, the data will be fetched once from the source and then used to create other tables using PowerQuery.

PowerBI reports run slowly in DirectQuery mode

I have a powerbi report for finance. Users need to see the latest data in real-time, so I have to choose DirectQuery. But in this mode, some functions, such as DateAdd and DatesMtd, cannot be used
(This DAX function is not supported for use in DirectQuery mode.),
So I need to write a very complex SQL statement to achieve the equivalent effect, but this makes the report very slow (more than 10 seconds) every time it runs, and the largest table in my data model is less than 80000 rows. I've tried to optimize the SQL statements, but it doesn't help. Any solution?
(I use powerbi report server with sqlserver enterprise version)
Of course, with no information, I can't know what's taking so much time, but in order to understand what's happening you can use the following tools:
PowerBI Performance Analyzer: This will tell you what part is taking the most time. for more info see MSDocs & SQLBI
Check the datamodel and the storage mode of each table involved (ie: fact table, calendar, customer, etc). When querying the source, PBI won't use filters (directly in the query) that come from tables in import mode. (search for "composite models" on the web)
Limit the number of objects, for each object in the dashboard a query will be sent to the datasource, limiting the number of objects might help. (remember that objects wait for each other, so one slow loading object might cause your problem)
(even if you probably already did it) Have a look at the query execution plan, you can also check it for queries automatically created by PowerBI by capturing them (the easiest way is to use SQL Server Profiler)
I think that just by using PowerBI Performance Analyzer you will be able to see where the problem is, and then do more accurate search about it.
You need to search for those keywords;
Native query in power query: Some M language functions can directly be translated to SQL, so that all transformation happens in sql server side.
Aggregated tables in model view: aggregated views can be added for specific needs of visuals. Ex: if a visual has product category and amount as value you can connect aggregated sql table to the original one so that visual can pick up the value faster.
Hybrid tables: import mode and DQ mode can be used together. so you can use DQ for daily data and import mode for older data together.

Using merge in Power Query while keeping native query

I'm trying to reduce my dataset of 1.000.000 records to only the subset I need (+/- 500) by creating an Inner Join to a different table. Unfortunataly it seems that Power Query drops the "native query" and loads the entire dataset before reducing it by merging it with a related table. I have no access to the database unfortunately, otherwise I would have written the SQL myself. Is there a way to make merge work with a native SQL query?
Thanks
I would first check that your "related table" query can run as a native query - right-click on it's last step and check if View Native Query is enabled.
If that's the case, then it may be due to the Join Kind in the Merge Queries step. I've noticed that against SQL Server data sources, Join Kinds other than the default Left Outer Join tend to kill the Native Query option.