7KH EDVLFV WKH PRGHO - Power BI Gebruikersgroep ·

Post on 22-Jan-2021

6 views 0 download

transcript

Gebruikersdag 2018

Kasper de JongePrincipal Program ManagerPower BI, Microsoft

The basics (the model)

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

Loading data

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

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.

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

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

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

Storing data

attribution

• 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

P2Pa

rtiti

on 1

Part

ition

1Pa

rtiti

on 2

Dictionary Col. Segment

• 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.

The model: supporting drag & drop through relationships

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

)

Country Name= “Canada”

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

Country Name= “Canada”

Country Name= “Canada”

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

Country Name= “Canada”

Country Name= “Canada”

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

Country Name= “Canada”

Country Name is the only filter

1. Apply filters2. Count remaining customers

Geography[Country Name] andProduct Category[Category Name]

are the filters

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”

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”

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”

‘Table’[Column],

Filters(‘Table’[Column]),

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] =

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

)

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

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]

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

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]

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])

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.

Direct Query

• 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” ..

• 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

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]

Filter by Warehouse

Filter by Warehouse

Filter by Warehouse

Filter by Warehouse

Filter by Warehouse

Filter by Groups of this user

Filter by Groups of this user

Filter by user Filter by user

Gebruikersdag 2018

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