Power BI Performance Tips & Tricks Callum Green 14/10/2017 Power BI Performance Tips & Tricks
Sponsors
About me Senior Business Intelligence Consultant Power BI / Query Editor for 2+ years Worked in BI for 8 years & Microsoft MCSE Email: callum.green@adatis.co.uk Blog: http://blogs.adatis.co.uk/callumgreen/
Agenda Direct Query / Live Connection Import Data Model File Size & Memory Query Folding Report Design
Direct Query / Live Connection Differences? Direct Query ONLY Relationships Change to Import mode Database Analysis Services Cube Relationships are obvious because an AS cube has pre built relationships built by a developer. Relationships are stored in the Power BI Model for Direct Query. Import – if you go to query editor and enter data, you are prompted to change to import mode Will now demo the two connection type and show you how you can access Quick Measures (preview feature) – released April 2017
Import Data Model – Table Structure Short, Wide Tall, Narrow Remove all fields not used for analysis Remove relationship ID’s not in use Exceptions to the rule? 10’s of millions of rows Pause and explain import mode A Power BI model is just an AS cube running on your local machine. Uses the vertipaq engine – now know as xvelocity. Which is designed to get up to 10x compression rates – tall/narrow tables compress better in general because of columnar storage Exception? - Xvelocity (Vertipaq) engine – partitions rows in 1 million chunks and interfere with compression rates , 8 million for tabular
Import Data Model – Data Types Avoid Strings as an ID Slower performance Larger data models Splitting Date & Time Avoid GUID’s / large text fields Split date & time – reduces unique records and splitting this into a time and date dimension massively reduces cardinality and improves compressions rates,
Import Data Model – Slicers Effects Dev/User Experience Issues 2 queries: Value in the list Related rows from table Cross filtering executed across sets of slicers High Cardinality Slicers = Slower performance
Import Data Model - DAX Calculated Column – Every refresh Measures – Run time DAX Examples: FILTER checks every individual row MIN/MAX scans entire table Vertipaq Alberto and Marco’s Excel Macro file that connects to Tabular – show them quickly how to get the connection to import cube.
Memory File size a rough estimate Check memory usage Kasper de Jonge Dashboard Background Data – Amount of data being processed in the background, not necessary for queries in your model that aren’t being worked on don’t necessarily need to be preview any time soon. Let it preview when needed.
Demo I want to show how we can reduce the size of our workbook file, which will help improve general performance and use less memory. This will lead to showing these two settings: Time intelligence – power bi setting – ill show you shortly
Query Folding (1 of 3) Reduced workloads Faster performance Increased productivity Reduced workloads client side Productivity from a dev perspective
Query Folding (2 of 3) Supported Transformations: Filtering (WHERE) Merge (JOIN) Aggregates and GROUP BY Pivot and Unpivot Numeric calculations Simple string manipulation e.g. UPPER - more specific to SQL
Agenda Query Folding (3 of 3) Limitations: Only some data sources supported Certain operations/functions prevent folding Merge Columns Replace Errors Buffer() M Function Certain filters – ‘This Month’ Currently, only a few sources are supported. Shown in previous slide. Stuff like Flat file sources and Excel doesn’t work. Also, if you do not structure your transformations correctly, query folding may not be applied As you’ll see in the demo, the SQL written is basically a sub query per PQ step Auto generated source code Reduced performance?
Agenda Report Design Performance Considerations: Shapes < 20 Maps Many data points Custom Visuals Third Party Demo Performance is mainly data and formula related, but bear these in mind. D3 for third party tools Although they are now embedded in Power BI Desktop and reliability of the ones in the store are usually reliable
Recap Enterprise: Basic self serve Live Connection / Direct Query Data mashup: Import Mode Remove other columns Query Fold Monitor: DAX File Size Memory Split out LC/DQ and Import mode
Agenda Resources Vertipaq Analyser - https://www.sqlbi.com/tools/vertipaq-analyzer/ Memory Usage in Power BI - https://www.kasperonbi.com/new-ssas-memory-usage-report-using-power-bi/ Dax Studio- https://daxstudio.codeplex.com/
Agenda Questions
Sponsors