7kh edvlfv wkh prgho - power bi gebruikersgroep ·

72
Gebruikersdag 2018 Kasper de Jonge Principal Program Manager Power BI, Microsoft

Upload: others

Post on 22-Jan-2021

11 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

Gebruikersdag 2018

Kasper de JongePrincipal Program ManagerPower BI, Microsoft

Page 2: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·
Page 3: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

The basics (the model)

Page 4: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·
Page 5: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·
Page 6: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

BI Semantic ModelData model Business logic and queries

Data access VertiPaq DirectQuery

DAX

Tabular

Third-partyapplications

ReportingServices Excel

Databases LOB Applications Files OData Feeds Cloud Services

Power BI

Power Query (M)

= Power BI Desktop

Page 7: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

Loading data

Page 8: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

Provides the Get Data experience for Power BI Desktop, providing consistent data access to 78+data sources.

Page 9: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

Connectivity to a wide range of data sources of various types, shapes, and sizes;

Highly interactive and intuitive experience for rapid and iterative construction of queries over any data source, any size.

Consistency of experience, and parity of query capabilities over all data sources.

Joins across different data sources.

Page 10: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·
Page 11: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

letSource = Web.Page(Web.Contents("http://www.bing.com/blogs/site_blogs/b/search/archive/2013/12/01/eoy.aspx")),WebTable = Source{0}[Data],RenamedColumns = Table.RenameColumns(WebTable,{{"Column1", "Rank"}, {"Column2", "2013"}})

inRenamedColumns

letSource = Sql.Database("localhost", "AdventureWorksDW2012"),DimCat = Source{[Schema="dbo",Item="DimProductCategory"]}[Data],DimSubCat = Source{[Schema="dbo",Item="DimProductSubcategory"]}[Data],DimCustomer = Source{[Schema="dbo",Item="DimCustomer"]}[Data],Joined = Table.NestedJoin(DimSubCat,{"CategoryKey"},DimCat,{"CategoryKey"},"Category",JoinKind.Inner)

inJoined

Page 12: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

letSource = Sql.Database("localhost", "AdventureWorksDW2012"),dbo_DimProduct = Source{[Schema="dbo",Item="DimProduct"]}[Data],RemovedOtherColumns = Table.SelectColumns(dbo_DimProduct,{"ProductKey", "EnglishProductName"}),RenamedColumns = Table.RenameColumns(RemovedOtherColumns,{{"EnglishProductName", "Product"}}),FilteredRows = Table.SelectRows(RenamedColumns, each [ProductKey] < 10)inFilteredRows

Page 13: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

letSource = Sql.Database("localhost", "AdventureWorksDW2012"),dbo_DimProduct = Source{[Schema="dbo",Item="DimProduct"]}[Data],RemovedOtherColumns = Table.SelectColumns(dbo_DimProduct,{"ProductKey", "EnglishProductName"}),RenamedColumns = Table.RenameColumns(RemovedOtherColumns,{{"EnglishProductName", "Product"}}),FilteredRows = Table.SelectRows(RenamedColumns, each [ProductKey] < 10) inFilteredRows

SELECT ProductKey, EnglishProductName as [Product]FROM [dbo].[DimProduct]WHERE [ProductKey] < 10

Page 14: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·
Page 15: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

Storing data

Page 16: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·
Page 17: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

attribution

Page 18: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·
Page 19: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·
Page 20: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

• All data is loaded “In-memory”

• Column based compression enables millions of rowsID Year Month SalesPerson Number

1 2010 Januari Jake 342 2010 Januari Adam 543 2010 Februari Tiffany 234 2010 Februari Jake 154

Page 21: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

P2Pa

rtiti

on 1

Part

ition

1Pa

rtiti

on 2

Dictionary Col. Segment

Page 22: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·
Page 23: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

• First data gets loaded through the PQ engine.• PQ passes to the AS Engine (streaming if

possible).• To stay query-able a copy of the data gets

created in memory.• After all data is loaded old data gets removed

and new data replaced.• Capacity \ Memory varies significantly.

Page 24: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

The model: supporting drag & drop through relationships

Page 25: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·
Page 26: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·
Page 27: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

1. Apply filters2. Sum Sales Amount on

rows that are left

This is the “Filter context”

EVALUATETOPN(

502,SUMMARIZECOLUMNS(

ROLLUPADDISSUBTOTAL('Geography’[EnglishCountryRegionName], "IsGrandTotalRowTotal"),"SumSalesAmount", CALCULATE(SUM('FactOnlineSales'[SalesAmount]))

),[IsGrandTotalRowTotal],0,'Geography'[EnglishCountryRegionName],1

)

Page 28: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

Country Name= “Canada”

Page 29: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·
Page 30: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·
Page 31: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

Country Name= “Canada”Country Name= “Canada”

Page 32: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·
Page 33: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·
Page 34: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

Country Name= “Canada”

Country Name= “Canada”

Country Name= “Canada”Country Name= “Canada”

Page 35: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·
Page 36: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·
Page 37: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

Country Name= “Canada”

Country Name= “Canada”

Country Name= “Canada”Country Name= “Canada”

Country Name= “Canada”

Page 38: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

Country Name is the only filter

Page 39: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·
Page 40: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·
Page 41: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·
Page 42: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

1. Apply filters2. Count remaining customers

Page 43: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

Geography[Country Name] andProduct Category[Category Name]

are the filters

Page 44: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

Country Name= “Canada”

Country Name= “Canada”

Country Name= “Canada”Country Name= “Canada”

Country Name= “Canada”

Category Name= “Bikes”

Category Name= “Bikes”Category Name= “Bikes”

Category Name= “Bikes”

Category Name= “Bikes”

Category Name= “Bikes”

Page 45: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·
Page 46: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

Country Name= “Canada”

Country Name= “Canada”

Country Name= “Canada”Country Name= “Canada”

Country Name= “Canada”

Category Name= “Bikes”

Category Name= “Bikes”Category Name= “Bikes”

Category Name= “Bikes”

Category Name= “Bikes”

Category Name= “Bikes”

Page 47: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·
Page 48: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

Country Name= “Canada”

Country Name= “Canada”

Country Name= “Canada”Country Name= “Canada”

Country Name= “Canada”

Category Name= “Bikes”

Category Name= “Bikes”Category Name= “Bikes”

Category Name= “Bikes”

Category Name= “Bikes”

Category Name= “Bikes”

Bi Directional relationship

Category Name= “Bikes”

Page 49: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·
Page 50: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·
Page 51: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·
Page 52: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

‘Table’[Column],

Filters(‘Table’[Column]),

Page 53: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

Year Month Date2012 1 1/1/2012 0:002012 2 2/1/2012 0:002012 3 3/1/2012 0:002012 4 4/1/2012 0:00

Date Revenue1/1/2012 0:00 34241/1/2012 0:00 324231/1/2012 0:00 3254562/1/2012 0:00 45432/1/2012 0:00 4323/1/2012 0:00 234233/1/2012 0:00 45364/1/2012 0:00 534674/1/2012 0:00 5644/1/2012 0:00 435344/1/2012 0:00 234

Filter Context

[Sum of Revenue] =

Page 54: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

Year Month Date2012 1 1/1/2012 0:002012 2 2/1/2012 0:002012 3 3/1/2012 0:002012 4 4/1/2012 0:00

Date Revenue1/1/2012 0:00 34241/1/2012 0:00 324231/1/2012 0:00 3254562/1/2012 0:00 45432/1/2012 0:00 4323/1/2012 0:00 234233/1/2012 0:00 45364/1/2012 0:00 534674/1/2012 0:00 5644/1/2012 0:00 435344/1/2012 0:00 234

Local Context

=CALCULATE([Sum of Revenue],FILTER(

ALL(DateTable), TRUE

)

Page 55: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

Year Month Date2012 1 1/1/2012 0:002012 2 2/1/2012 0:002012 3 3/1/2012 0:002012 4 4/1/2012 0:00

Date Revenue1/1/2012 0:00 34241/1/2012 0:00 324231/1/2012 0:00 3254562/1/2012 0:00 45432/1/2012 0:00 4323/1/2012 0:00 234233/1/2012 0:00 45364/1/2012 0:00 534674/1/2012 0:00 5644/1/2012 0:00 435344/1/2012 0:00 234

=CALCULATE([Sum of Revenue],FILTER(

ALL(DateTable),DateTable[Date] <= MAX(DateTable[Date]))

) Local Context

Page 56: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·
Page 57: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

Year Month Date Column2012 2 2/1/2012 0:002012 3 3/2/2012 0:002012 3 3/3/2012 0:002012 4 4/4/2012 0:002012 4 4/5/2012 0:002010 1 1/9/2010 0:002010 1 1/10/2010 0:002010 1 1/11/2010 0:002010 1 1/12/2010 0:002010 1 1/13/2010 0:00

Column2012 - 22012 – 32012 – 32014 - 42014 - 42010 - 12010 - 12010 - 12010 - 12010 - 1

=[Year] & “ – “ & [Month]

Page 58: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

Year Month Date Sales2012 2 2/1/2012 0:002012 3 3/2/2012 0:002012 3 3/3/2012 0:002012 4 4/4/2012 0:002012 4 4/5/2012 0:002010 1 1/9/2010 0:002010 1 1/10/2010 0:002010 1 1/11/2010 0:002010 1 1/12/2010 0:002010 1 1/13/2010 0:00

=SUM(Invoice[RevenueAmount])

Date Revenue1/1/2012 0:00 34241/1/2012 0:00 324231/1/2012 0:00 3254562/1/2012 0:00 45432/1/2012 0:00 4323/1/2012 0:00 234233/1/2012 0:00 45364/1/2012 0:00 534674/1/2012 0:00 5644/1/2012 0:00 435344/1/2012 0:00 234

Sales23423523234235232342352323423523234235232342352323423523234235232342352323423523

Page 59: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

Year Month Date Sales2012 2 2/1/2012 0:00 49752012 3 3/2/2012 0:00 3212012 3 3/3/2012 0:00 42352012 4 4/4/2012 0:00 131212012 4 4/5/2012 0:00 32562010 1 1/9/2010 0:00 3232010 1 1/10/2010 0:00 123122010 1 1/11/2010 0:00 3232010 1 1/12/2010 0:00 42562010 1 1/13/2010 0:00 2342234

=SUM(Invoice[RevenueAmount])

Date Revenue1/1/2012 0:00 34241/1/2012 0:00 324231/1/2012 0:00 3254562/1/2012 0:00 45432/1/2012 0:00 4323/1/2012 0:00 234233/1/2012 0:00 45364/1/2012 0:00 534674/1/2012 0:00 5644/1/2012 0:00 435344/1/2012 0:00 234=CALCULATE(SUM(Invoice[RevenueAmount])

=[Sum of Revenue]

Page 60: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·
Page 61: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

Region Sum of RevenueCENTRAL $2,834,229.90EAST $9,944,362.23NORTH $7,000,295.34SOUTH $2,841,183.08WEST $6,881,882.72

=AVERAGEX(ALL(PoliticalGeography[Region]),[Sum of Revenue])

Page 62: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

Recap, DAX

• DAX can be used to express business logic• It is designed to use in memory data

• DAX uses the “Row” and “Filter” context created by using the model.

Page 63: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

Direct Query

Page 64: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

• Don’t want to wait for data to load, need “real time” data

• Want to leverage a single security model

• They trust their data source to handle:• Performant analytical query patterns• Concurrency • Security

• But most data sources are not ready for the “onslaught” ..

Page 65: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

• Optimize for analytics• System should handle querying of dimensions and facts • Analytical “ready” data source helps

• SQL Server in memory• Netezza• HANA

• Consider your use cases:• Enterprise wide reporting (> concurrency)• Ad hoc analytics? (a few users)

• Optimize your model for DQ

Tip: Use an optimized data source if possible

Page 66: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

From:SELECTTOP (1000001) [t1].[RegionCountryName],SUM([t2].[DiscountAmount])AS [a0]FROM((( SELECT [dbo].[FactOnlineSalesVBig].* FROM [dbo].[FactOnlineSalesVBig] ) AS [t2]left outer join( SELECT [dbo].[DimCustomer].* FROM [dbo].[DimCustomer] ) AS [t3] on([t2].[CustomerKey] = [t3].[CustomerKey]))left outer join( SELECT [dbo].[DimGeography].* FROM [dbo].[DimGeography] ) AS [t1] on([t3].[GeographyKey] = [t1].[GeographyKey]))GROUP BY [t1].[RegionCountryName]

TO:SELECTTOP (1000001) [t1].[RegionCountryName],SUM([t2].[DiscountAmount])AS [a0]FROM((( SELECT [dbo].[FactOnlineSalesVBig].* FROM [dbo].[FactOnlineSalesVBig] ) AS [t2]INNER JOIN( SELECT [dbo].[DimCustomer].* FROM [dbo].[DimCustomer] ) AS [t3] on([t2].[CustomerKey] = [t3].[CustomerKey]))INNER JOIN( SELECT [dbo].[DimGeography].* FROM [dbo].[DimGeography] ) AS [t1] on([t3].[GeographyKey] = [t1].[GeographyKey]))GROUP BY [t1].[RegionCountryName]

Page 67: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

Filter by Warehouse

Filter by Warehouse

Filter by Warehouse

Filter by Warehouse

Filter by Warehouse

Page 68: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

Filter by Groups of this user

Filter by Groups of this user

Filter by user Filter by user

Page 69: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·
Page 70: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·
Page 71: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·
Page 72: 7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

Gebruikersdag 2018

Bedankt!Vergeet niet de evaluatie in te vullen!Scan de QR code.