Mostrando las entradas con la etiqueta Power BI. Mostrar todas las entradas
Mostrando las entradas con la etiqueta Power BI. Mostrar todas las entradas

sábado, 8 de enero de 2022

Power BI Hybrid tables - Freedom to choose what you load

Autor: Miguel Peredo Zurcher


(Update 30.January.2022, Hybrid tables now work with Snowflake) (see here)


As an introduction, let's agree that we want dashboards with response times of less than one second. Nobody enjoys (or uses) dashboards that take two or more seconds to load.


How do you achieve fast-loading dashboards in BI?


BI tools have two access modes: Load Mode and Live or Direct Query Mode. In Load Mode, the data is copied (loaded, imported) from the source to the in-memory layer of the BI tool, which for specific volumes provides a sub-second response time. In Direct Query mode, the response time of the dashboard depends on the response time of the source where the tool is connected, which usually is not a sub-second time. There are other aspects to consider to Load Mode (import) or Direct Query mode (live); check your BI tool documentation.


Most cloud Dataware house-oriented products have an incredible response time, they can process vast amounts of data, and the response time will be just a couple of seconds, but not below one second. 


Because of this, you must first load the data to the BI tool (load mode), which is usually an in-memory layer that will respond in less than one second for most cases. And then, query the data from this layer.


So far, so good; we can load our data to the in-memory layer of the BI tool, and our sub-second response time challenge is solved, but can we really load all our data to the in-memory layer?


The answer is a qualified yes. Loading the data to BI tool in-memory engine had some challenges:

  • In-memory is expensive 
  • The complexity of doing incremental loads 
  • Stale dashboards accentuated by streaming and frequent updates into the source data


These challenges have had workarounds, such as Power BI aggregates, allowing you to load aggregated data into the in-memory capacity. But as you can see, there is still the need to load from the data warehouse to the in-memory layer. 


I must mention that several vendors are working on putting an ultra-fast layer on top of their data warehouse solution, for example: What is BigQuery BI Engine? | Google CloudUsing the Search Optimization Service — Snowflake Documentation, etc.


Making an extra load impacts the freshness of the data in your dashboard, meaning the data that has been written (maybe streamed) to the data warehouse is not visible on the dashboard until you do the next load.


Power BI has now a great feature (in public preview) that allows you to tackle the challenges mentioned before; here is the official announcement: Announcing Public Preview of Hybrid Tables in Power BI Premium | Microsoft Power BI Blog | Microsoft Power BI


What can you do with Power BI Hybrid Tables?


It allows you to decide which parts of a table (usually a fact table, like sales for the last ten years) to load in the in-memory layer and which parts you keep in the source but still accessible in the dashboards with different response times.


For example, your Sales table could look like this:





In part A, you have the data has been inserted into the source after the last load to B.

In part B, you have sales data from the previous two years, which resides in memory. You load this data in a scheduled way. (For example, every 8 hours).

In part C, you have historical data.



The objective is to make all the data available for the BI dashboards. 


The access modes for different parts of the Sales table are: 

For A - Direct Query Mode. Response time is acceptable when querying from the source since it's a small amount of data. 

For B - Load Mode. The performance of querying from memory will be top of the line. Most dashboard queries will hit only the last two years of data (as agreed with the business). 

For C - Direct Query Mode. For queries that span more than the last two years, the performance will depend on the source. But again, this is what the business requested.


All this is transparent to the report creators; for them is just another table, but behind the scenes, it is a union of in-memory and direct queries, automatically managed by Power BI.  


If that layout does not fit your scenario, you have the freedom to choose what goes to the in-memory (load mode) and what stays in the source. 


Do you want to try it out?

Remember that you need Power BI Premium (can be PPU or Capacity)


And I suggest following the instructions from the blog mentioned above: Announcing Public Preview of Hybrid Tables in Power BI Premium | Microsoft Power BI Blog | Microsoft Power BI


When experimenting, I first tried Snowflake, but it did not work. I suppose because the feature is still in preview. I posted the issue in the Power BI community:

Hybrid Tables, Snowflake and Query Folding - Microsoft Power BI Community

(Update 30.January.2022, Hybrid tables now work with Snowflake) 


Then I tried Synapse, and it worked.


After publishing to the Power BI premium and doing one refresh that created the partitions, I used Tabular Model Editor to see the partitions and check for each partition if those are in Load Mode or Direct Query Mode. The Tabular Model Editor also allowed me to change the settings for the partitions, but as mentioned in the Blog from Power BI, you can also make the changes programmatically. 


Some screenshots:







lunes, 20 de agosto de 2018

Composite Models: Live data (from SAP HANA) and load data from Excel in one single model using Power BI

Hi,

On July 2018, Microsoft announced the availability of "Storage Mode" (still in Preview mode, not ready for Production) in Power BI, giving you the chance to decide for each table if the table will be:

- Import
- Direct Query (Live)
- Dual

This is a great option, especially, if you think that for some models:

a) You do not want to Import (copy) the whole dataset to your model because it is is too big or will add latency.

b) You need to combine Direct query (Live) data with other data (before July 2018 this was not possible, when you were using a direct query, there was no possibility to add load data)

A possible scenario could be; you have your actuals coming from a HANA System (BW, S/4, etc.) which usually are millions of records, you do not want to load this to Power BI. (Point a) ). For the actuals, you use a live (direct query) connection to HANA, but for your projections, you get the data from Excel. (Load Mode).

The schema will look:


1) Trough the direct query (live) connection you are getting the Actuals and Plan. The table is called "Hana_Live" and the storage mode is "Direct Query" as can be seen here:

2) From the Excel file, we loaded the projections. The table is called "Projection_Excel" and the storage mode is "Import".



3) And the last step is to combine this two tables to be able to create the report, because of the model we need to make a union; and yes it's possible to make a union with Import and direct query tables, with the standard expression: UnionCombined = union(HANA_LIve,Proyection_Excel)


Another way of showing this is:


As you can see this is a great new feature that enables a lot of new modeling options, hopefully, this becomes generally available soon.

Any experiences with this?

I also found interesting that here:
https://docs.microsoft.com/en-us/power-bi/desktop-storage-mode
It says that:
The following multidimensional sources cannot be used with composite models:
  • SAP HANA
  • SAP Business Warehouse
  • SQL Server Analysis Services
  • Power BI datasets
but enabling the option treat HANA as the relational source allows the possibility of using HANA in composite models.