PDF Power BI Cheat Sheet12
PDF Power BI Cheat Sheet12
PDF Power BI Cheat Sheet12
4. Remove columns you are not going to use in your report. Prefer ‘Remove Other Columns’ above the 3. Give measures a prefix (%, #, €).
‘Remove Columns’ option, for lower risk that structural changes in your data source break the query. 4. Use abbreviations like YTD, LY, PY, PP as a suffix, to keep the base fields together in the sort order.
5. Maximize the use of Query Folding for faster and more efficient queries. With Query Folding, multiple 5. Hide columns that are needed but are irrelevant for the user.
transformations are merged as one query and then sent to the source. If ‘View Native Query’ is not 6. Hide the key at the many side of a many-to-one relation (e.g. [OrderDate] in the ‘Revenue’ table).
available, Query Folding has stopped before that step.
7. For each measure column in your data model, make a DAX Calculated Measure instead of using the
6. In general, prefer “Import” over “DirectQuery”. Unless the amount of data is too large to import, or ‘Default Summarization’, then hide the original column. This way all measures will have the same
when there are other requirements (like real-time insights). icon. And it enables you to easily change the calculation in the future (e.g. adding a filter condition).
7. Use Date.From instead of DateTime.Date to extract a date from another field, and to make sure Also, it is easier to reference this measure in other DAX calculations.
query folding won’t break. More info on this blog post: http://bit.ly/DateFrom. 8. Always use the table name when you refer to a column, for example: ‘Product’[Category].
8. Turn off ‘Enable Load’ for queries/tables that you don’t need in the Data Model. 9. Use DIVIDE() to prevent division by 0, and to improve the speed of your divisions.
9. Re-use Power Query code and lower impact on your data source by using Power BI dataflows. 10. Use IsInScope to get the right hierarchy level in DAX (read all about it in Kasper de Jonge’s blog:
10. Turn on the Formula Bar so you get familiar with Power Query (M) code. https://bit.ly/KasperOnBIInScope).
11. Automatically beautify all column names in a query, e.g. “CustomerName” → “Customer Name”, by 11. In DAX: (un)comment DAX lines by pressing Alt + Shift + A or CTRL + /, and Shift + Enter for line breaks.
using the Power Query function Alex Powers shared on his GitHub repo: http://bit.ly/PQSplitByCase. 12. Use aggregations to keep your model small and performant, and still have all detailed data available.
Note: he also has a function to replace underscores in all column names automatically. 13. Use Tabular Editor to make changes to your Power BI file (currently unsupported by Microsoft). Also,
make sure to check-out its best-practices analyzer.
Code examples (don’t forget that Power Query / M is case-sensitive!) 14. Avoid bi-directional cross filtering and make use of measure filters http://bit.ly/MeasureFilters.
• if T > 0 then A else B 15. For very large models, group measures or fields in display folders for better usability.
• try A/B otherwise 0 16. Use DAX Studio to capture all DAX queries executed on your Premium Capacity.
• #table( { “X”, “Y” }, { { 1, 2 }, { 3, 4 } } ) 17. Keep your PBI desktop file fast and small by using TOP N (http://bit.ly/ImproveReportBuilding) and
• DateTime.LocalNow() switch underlying data source in PBI service after publishing (http://bit.ly/ParameterizeDatasource).
• Date.From( DateTime.LocalNow() )
Resources
• Excel.Workbook(Web.Contents("[url]/[filename].xlsx"), null, true)
• #shared to list all functions and get PQ documentation • Increase the readability of your DAX calculations: https://www.daxformatter.com.
• Use DAX Studio to analyze and tune your calculations: http://daxstudio.org.
Resources • Find all about DAX expressions: https://dax.guide.
• Power Query M Formula Reference: http://bit.ly/PQMReference. • Use Tabular Editor to easily build and manage your models: https://tabulareditor.github.io/.
• Repo by Imke Feldmann with a lot of custom Power Query functions: https://github.com/ImkeF/M/.
Resources
• OK VIZ Visual reference: https://sqlbi.com/ref/power-bi-visuals-reference. Dave Ruijter Marc Lelijveld
• SQL Jason Financial Times Visual Vocabulary: https://bit.ly/SQLJasonVisualVocabulary. linkedin.com/in/daveruijter linkedin.com/in/marclelijveld
twitter.com/daveruijter twitter.com/marclelijveld
I’VE GOT THE POWER BI https://moderndata.ai/ https://data-marc.com/