SlideShare ist ein Scribd-Unternehmen logo
1 von 40
Downloaden Sie, um offline zu lesen
#sqlsat
Progetto Power BI – Un Decalogo
Lorenzo Vercellati
Speaker
 Business Intelligence Specialist @ SolidQ
 Data Visualization Addicted
 Speaker al SQL Saturday
 DIAD Trainer
 PBIUG Milan Administrator
 @supergimi
 lorenzovercellati
Agenda
 Centralizzare la DataSource
 A ciascuno la sua dieta
 Lavoriamo solo su misure
 Calendar & Time Dimension from scratch
 Filters Applied
 A ciascuno il suo visual
 Custom Topojson
 Tips, Tricks & Tools
 Buone letture
Il Progetto PowerBI
Il Progetto BI
DataSource
ETL Flow
Visuals
Data Model
Il Progetto PowerBI
DataSource
ETL Flow
Visuals
Data Model
Centralizzare e Parametrizzare
la DataSource
Centralizzare la DataSource
Data
Source
Data
Set
Data
Set
Data
Source
Data
Source
Data
Set
Data
Set
A Ciascuno la sua dieta
Vertipaq Storage
Tab
XXX
XXX
YYY
ZZZ
AAA
AAA
AAA
Diz
XXX
YYY
ZZZ
AAA
Tab
XX.A
XX.B
YY.A
ZZ.A
ZZ.C
XX.C
YY.C
Diz
XX.A
XX.B
YY.A
ZZ.A
ZZ.C
XX.C
YY.C
Togliere ai Ricchi

Tab
XX A
XX B
YY A
ZZ A
ZZ C
XX C
YY C
Diz
XX
YY
ZZ
XX
YY
Tab
XX
XX
YY
ZZ
ZZ
XX
YY
Tab
A
B
A
A
C
C
C
Diz
A
B
A
C
Tab
XX.A
XX.B
YY.A
ZZ.A
ZZ.C
XX.C
YY.C

e dare ai Poveri
Se non abbiamo Longitudine e Latitudine dobbiamo affidarci ai
nomi dei luoghi geografici!
I casi di omonimia geografica sono tantissimi e i servizi di
geolocalizzazione di Bing non sempre rispondono a dovere.
PiĂč informazioni gli diamo, piĂč facile sarĂ  il loro lavoro e piĂč
precise saranno le risposte.
Categorizziamo sempre le colonne geografiche.
Lavoriamo solo su misura
Lavoriamo solo su Misura
Per il semplice fatto che Power BI ce le
propone come misure, non significa che
dobbiamo usare le colonne numeriche
come misure nei visual!
Lavoriamo solo su Misura
 Creo le misure Base a partire dalle colonne
numeriche
ColValue
TotaleValue
TotaleValue
PreviousYear
Saldo vs
PreviousYear
% vs
PreviousYear
 Creo le misure Complesse a partire dalle
misure Base
 Nascondo le colonne
Calendar and Time Dimension
from scratch
All You Need is Date Dim
All You Need is Date Dim
let
StartDate = #date(StartYear,12,1),
// EndDate = #date(EndYear,12,31),
EndDate = Date.From(DateTime.LocalNow()),
NumberOfDays = Duration.Days( EndDate - StartDate ),
Dates = List.Dates(StartDate, NumberOfDays+1, #duration(1,0,0,0)),
#"Converted to Table" = Table.FromList(Dates, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Renamed Columns" = Table.RenameColumns(#"Converted to Table",{{"Column1", "FullDateAlternateKey"}}),
#"Changed Type" = Table.TransformColumnTypes(#"Renamed Columns",{{"FullDateAlternateKey", type date}}),
#"Inserted Year" = Table.AddColumn(#"Changed Type", "Year", each Date.Year([FullDateAlternateKey]), type number),
#"Inserted Month" = Table.AddColumn(#"Inserted Year", "Month Number", each Date.Month([FullDateAlternateKey]), type number),
#"Inserted Month Name" = Table.AddColumn(#"Inserted Month", "Month", each Date.MonthName([FullDateAlternateKey]), type text),
#"Inserted Quarter" = Table.AddColumn(#"Inserted Month Name", "Quarter Number", each Date.QuarterOfYear([FullDateAlternateKey]), type number),
#"Inserted Week of Year" = Table.AddColumn(#"Inserted Quarter", "Week of Year", each Date.WeekOfYear([FullDateAlternateKey]), type number),
#"Inserted Week of Month" = Table.AddColumn(#"Inserted Week of Year", "Week of Month", each Date.WeekOfMonth([FullDateAlternateKey]), type number),
#"Inserted Day" = Table.AddColumn(#"Inserted Week of Month", "Day", each Date.Day([FullDateAlternateKey]), type number),
#"Inserted Day of Week" = Table.AddColumn(#"Inserted Day", "Day of Week Number", each Date.DayOfWeek([FullDateAlternateKey],1), type number),
#"Inserted Day of Year" = Table.AddColumn(#"Inserted Day of Week", "Day of Year", each Date.DayOfYear([FullDateAlternateKey]), type number),
#"Inserted Day Name" = Table.AddColumn(#"Inserted Day of Year", "Day of Week", each Date.DayOfWeekName([FullDateAlternateKey]), type text),
#"Inserted Year Month" = Table.AddColumn(#"Inserted Day Name", "Year Month Number", each [Year] * 100 + [Month Number], type number),
#"Inserted Year Month Name" = Table.AddColumn(#"Inserted Year Month", "Year Month", each Text.Combine({[Month], " ", Text.From([Year], "en-US")}), type text),
#"Inserted Year Quarter" = Table.AddColumn(#"Inserted Year Month Name", "Year Quarter Number", each [Year] * 10 + [Quarter Number], type number),
#"Inserted Quarter Name" = Table.AddColumn(#"Inserted Year Quarter", "Quarter", each Text.Combine({"Q", Text.From([Quarter Number], "en-US")}), type text),
#"Inserted Year Quarter Name" = Table.AddColumn(#"Inserted Quarter Name", "Year Quarter", each Text.Combine({[Quarter], " ", Text.From([Year], "en-US")}), type text),
#"Inserted Year Week" = Table.AddColumn(#"Inserted Year Quarter Name", "Year Week Number", each [Year] * 100 + [Week of Year], type number),
#"Inserted Year Week Name" = Table.AddColumn(#"Inserted Year Week", "Year Week", each Text.Combine({"Week", " ", Text.From([Week of Year], "en-US"), " ", Text.From([Year], "en-US")}), type text),
#"Renamed Columns1" = Table.RenameColumns(#"Inserted Year Week Name",{{"FullDateAlternateKey", "Date"}})
in
#"Renamed Columns1"
All You Need is Date Dim
let
SecondCount = 86400,
Source = List.Times(#time(0, 0, 0),SecondCount, #duration(0,0,0,1)),
TableFromList = Table.FromList(Source, Splitter.SplitByNothing()),
ChangedType = Table.TransformColumnTypes(TableFromList,{{"Column1", type time}}),
RenamedColumns = Table.RenameColumns(ChangedType,{{"Column1", "Time"}}),
InsertHour = Table.AddColumn(RenamedColumns, "Hour", each Time.StartOfHour([Time])),
InsertMinute = Table.AddColumn(InsertHour, "Minute", each Time.Minute([Time])),
ChangedTypeHour = Table.TransformColumnTypes(InsertMinute,{{"Hour", type time}}),
InsertQuarterHour = Table.AddColumn(ChangedTypeHour, "Quarter Hour", each if [Minute]<15 then [Hour] else if [Minute] < 30 then Value.Add([Hour],#duration(0,0,15, 0)) else if [Minute] < 45 then
Value.Add([Hour],#duration(0,0,30, 0)) else Value.Add([Hour],#duration(0,0,45, 0))),
ChangedTypeQtrHr = Table.TransformColumnTypes(InsertQuarterHour,{{"Quarter Hour", type time}}),
ReorderedColumns = Table.ReorderColumns(ChangedTypeQtrHr,{"Time", "Hour", "Quarter Hour", "Minute"}),
InsertHourNumber = Table.AddColumn(ReorderedColumns, "Hour Number", each Time.Hour([Time])),
NextHour = Table.AddColumn(InsertHourNumber, "Next Hour", each Value.Add([Hour],#duration(0,1,0, 0))),
NextQuarterHour = Table.AddColumn(NextHour, "Next Quarter Hour", each Value.Add([Quarter Hour],#duration(0,0,15, 0))),
InsertPeriod = Table.AddColumn(NextQuarterHour, "Period of Day",
each if [Hour Number] >= 0 and [Hour Number] < 4 then "After Midnight" else
if [Hour Number] >= 4 and [Hour Number] < 8 then "Early Morning" else
if [Hour Number] >= 8 and [Hour Number] < 12 then "Late Morning" else
if [Hour Number] >= 12 and [Hour Number] < 16 then "Afternoon" else
if [Hour Number] >= 16 and [Hour Number] < 20 then "Evening" else "Late Night"),
InsertPeriodSort = Table.AddColumn(InsertPeriod, "PeriodSort", each
if [Hour Number] >= 0 and [Hour Number] < 4 then 0 else
if [Hour Number] >= 4 and [Hour Number] < 8 then 1 else
if [Hour Number] >= 8 and [Hour Number] < 12 then 2 else
if [Hour Number] >= 12 and [Hour Number] < 16 then 3 else
if [Hour Number] >= 16 and [Hour Number] < 20 then 4 else 5),
InsertTimeKey = Table.AddColumn(InsertPeriodSort, "TimeKey", each Time.ToText([Time], "HHmm"), type text)
in
InsertTimeKey
Applied Filters
Applied Filters: un po’ di Chiarezza
Applied Filters: una Nuova Frontiera
From: https://www.sqlbi.com/articles/displaying-filter-context-in-power-bi-tooltips/
A ciascuno il suo Visual
Cleveland and McGill
Anche l’occhio vuole la sua parte

L’occhio umano non ù fatto per misurare gli
angoli ma lunghezze e distanze.
(cit. Alberto Cario, L’Arte Funzionale)
Tools
DAX Studio
Vertipaq Analyzer
Power BI Helper
Tips
M Helper
= #shared
Power Query Alert
PowEr qUeRy Ăš CaSe sENsItivE
PowerBi Dataflows
I dataflows sono dataset condivisi?
Per i dataflows serve Premium Storage?
Posso combinare query su dataflows senza
Premium Storage?
NO!
NO!
NO


Anzi SI!
Tricks
0
12
3
4
5
6
7
8
9
10
11
12
13
14 15
16
17
20
21
22
23
24
25
26
27
28
30
31
33
34
35
36
37
38
39
40
41
42
43
4
4
45
46
47
49
51
52
53
54
80
78
79
85
76
77
86
Customizzare Topojson
Se non hai una mappa da convertire in topojson
Se non hai alternative (QGIS),
puoi sempre editare manualmente il file topojson
che generata la mappa
Topojson Ăš un sottotipo del geojson file type
La struttura di un Topojson consistse in:
Una lista di arcs (segmenti)
Una lista di oggetti (poligoni) definiti da una
sequenza ordinata e chiusa di segmenti
0
12
3
4
5
6
7
8
9
10
11
12
13
14 15
16
17
20
21
22
23
24
25
26
27
28
30
31
33
34
35
36
37
38
39
40
41
42
43
4
4
45
46
47
49
51
52
53
54
80
78
79
85
76
77
86
Customizzare Topojson
Ogni Arc Ăš definito da un entry point e da una
sequenza di punti.
Ogni Arc ha una direzione definita
Gli oggetti definiti da un arc con direzione opporta
sono referenziati come –1 * (arc + 1)
76
-77
Bibliografia
Buone Letture
PowerQuery
Chriss Webb: https://blog.crossjoin.co.uk/
DAX
SQLBI: https://www.sqlbi.com/articles/
PowerBI
Reza Rad: http://radacad.com/blog
Guy in a Cube: https://www.youtube.com/channel/UCFp1vaKzpfvoGai0vE5VJ0w
Dataflows
BI Polar: https://ssbipolar.com/2018/10/23/dataflows-in-power-bi/
Grazie!

Weitere Àhnliche Inhalte

Ähnlich wie Sql saturday 829_decalogo_powerbi

What's New for Developers in SQL Server 2008?
What's New for Developers in SQL Server 2008?What's New for Developers in SQL Server 2008?
What's New for Developers in SQL Server 2008?ukdpe
 
SQL Server 2008 Overview
SQL Server 2008 OverviewSQL Server 2008 Overview
SQL Server 2008 OverviewEric Nelson
 
Chapter 16-spreadsheet1 questions and answer
Chapter 16-spreadsheet1  questions and answerChapter 16-spreadsheet1  questions and answer
Chapter 16-spreadsheet1 questions and answerRaajTech
 
Adopting F# at SBTech
Adopting F# at SBTechAdopting F# at SBTech
Adopting F# at SBTechAntya Dev
 
Business Intelligence Portfolio
Business Intelligence PortfolioBusiness Intelligence Portfolio
Business Intelligence PortfolioChris Seebacher
 
Connect() Mini 2016
Connect() Mini 2016Connect() Mini 2016
Connect() Mini 2016Jeff Chu
 
Who killed object oriented design?
Who killed object oriented design?Who killed object oriented design?
Who killed object oriented design?Amir Barylko
 
Less08 Schema
Less08 SchemaLess08 Schema
Less08 Schemavivaankumar
 
Introduction to MS Excel
Introduction to MS ExcelIntroduction to MS Excel
Introduction to MS ExcelTarek Dib
 
e computer notes - Creating and managing tables
e computer notes -  Creating and managing tablese computer notes -  Creating and managing tables
e computer notes - Creating and managing tablesecomputernotes
 
Les09 (using ddl statements to create and manage tables)
Les09 (using ddl statements to create and manage tables)Les09 (using ddl statements to create and manage tables)
Les09 (using ddl statements to create and manage tables)Achmad Solichin
 
Sql server 2016: System Databases, data types, DML, json, and built-in functions
Sql server 2016: System Databases, data types, DML, json, and built-in functionsSql server 2016: System Databases, data types, DML, json, and built-in functions
Sql server 2016: System Databases, data types, DML, json, and built-in functionsSeyed Ibrahim
 
MongoDB World 2018: Using Change Streams to Keep Up with Your Data
MongoDB World 2018: Using Change Streams to Keep Up with Your DataMongoDB World 2018: Using Change Streams to Keep Up with Your Data
MongoDB World 2018: Using Change Streams to Keep Up with Your DataMongoDB
 
A Rusty introduction to Apache Arrow and how it applies to a time series dat...
A Rusty introduction to Apache Arrow and how it applies to a  time series dat...A Rusty introduction to Apache Arrow and how it applies to a  time series dat...
A Rusty introduction to Apache Arrow and how it applies to a time series dat...Andrew Lamb
 
SessionSeven_WorkingWithDatesandTime
SessionSeven_WorkingWithDatesandTimeSessionSeven_WorkingWithDatesandTime
SessionSeven_WorkingWithDatesandTimeHellen Gakuruh
 

Ähnlich wie Sql saturday 829_decalogo_powerbi (20)

What's New for Developers in SQL Server 2008?
What's New for Developers in SQL Server 2008?What's New for Developers in SQL Server 2008?
What's New for Developers in SQL Server 2008?
 
SQL Server 2008 Overview
SQL Server 2008 OverviewSQL Server 2008 Overview
SQL Server 2008 Overview
 
Bw14
Bw14Bw14
Bw14
 
Chapter 16-spreadsheet1 questions and answer
Chapter 16-spreadsheet1  questions and answerChapter 16-spreadsheet1  questions and answer
Chapter 16-spreadsheet1 questions and answer
 
Adopting F# at SBTech
Adopting F# at SBTechAdopting F# at SBTech
Adopting F# at SBTech
 
Business Intelligence Portfolio
Business Intelligence PortfolioBusiness Intelligence Portfolio
Business Intelligence Portfolio
 
Connect() Mini 2016
Connect() Mini 2016Connect() Mini 2016
Connect() Mini 2016
 
Who killed object oriented design?
Who killed object oriented design?Who killed object oriented design?
Who killed object oriented design?
 
Less08 Schema
Less08 SchemaLess08 Schema
Less08 Schema
 
Introduction to MS Excel
Introduction to MS ExcelIntroduction to MS Excel
Introduction to MS Excel
 
Les09
Les09Les09
Les09
 
e computer notes - Creating and managing tables
e computer notes -  Creating and managing tablese computer notes -  Creating and managing tables
e computer notes - Creating and managing tables
 
Les09 (using ddl statements to create and manage tables)
Les09 (using ddl statements to create and manage tables)Les09 (using ddl statements to create and manage tables)
Les09 (using ddl statements to create and manage tables)
 
Office
OfficeOffice
Office
 
Les09
Les09Les09
Les09
 
Sql server 2016: System Databases, data types, DML, json, and built-in functions
Sql server 2016: System Databases, data types, DML, json, and built-in functionsSql server 2016: System Databases, data types, DML, json, and built-in functions
Sql server 2016: System Databases, data types, DML, json, and built-in functions
 
MongoDB World 2018: Using Change Streams to Keep Up with Your Data
MongoDB World 2018: Using Change Streams to Keep Up with Your DataMongoDB World 2018: Using Change Streams to Keep Up with Your Data
MongoDB World 2018: Using Change Streams to Keep Up with Your Data
 
A Rusty introduction to Apache Arrow and how it applies to a time series dat...
A Rusty introduction to Apache Arrow and how it applies to a  time series dat...A Rusty introduction to Apache Arrow and how it applies to a  time series dat...
A Rusty introduction to Apache Arrow and how it applies to a time series dat...
 
How to Use JSON in MySQL Wrong
How to Use JSON in MySQL WrongHow to Use JSON in MySQL Wrong
How to Use JSON in MySQL Wrong
 
SessionSeven_WorkingWithDatesandTime
SessionSeven_WorkingWithDatesandTimeSessionSeven_WorkingWithDatesandTime
SessionSeven_WorkingWithDatesandTime
 

Mehr von Lorenzo Vercellati

SQL Start! 2021 - The hidden treasure inside power bi
SQL Start! 2021 - The hidden treasure inside power biSQL Start! 2021 - The hidden treasure inside power bi
SQL Start! 2021 - The hidden treasure inside power biLorenzo Vercellati
 
Power BI - Choose your map
Power BI - Choose your mapPower BI - Choose your map
Power BI - Choose your mapLorenzo Vercellati
 
Power BI - Dynamic role level security
Power BI - Dynamic role level securityPower BI - Dynamic role level security
Power BI - Dynamic role level securityLorenzo Vercellati
 
Data saturday # 0001 - The hidden treasure inside Power BI
Data saturday # 0001 - The hidden treasure inside Power BIData saturday # 0001 - The hidden treasure inside Power BI
Data saturday # 0001 - The hidden treasure inside Power BILorenzo Vercellati
 

Mehr von Lorenzo Vercellati (6)

SQL Start! 2021 - The hidden treasure inside power bi
SQL Start! 2021 - The hidden treasure inside power biSQL Start! 2021 - The hidden treasure inside power bi
SQL Start! 2021 - The hidden treasure inside power bi
 
Power BI - Choose your map
Power BI - Choose your mapPower BI - Choose your map
Power BI - Choose your map
 
Power BI - Dynamic role level security
Power BI - Dynamic role level securityPower BI - Dynamic role level security
Power BI - Dynamic role level security
 
Choose the right visual
Choose the right visualChoose the right visual
Choose the right visual
 
Data saturday # 0001 - The hidden treasure inside Power BI
Data saturday # 0001 - The hidden treasure inside Power BIData saturday # 0001 - The hidden treasure inside Power BI
Data saturday # 0001 - The hidden treasure inside Power BI
 
Team management
Team managementTeam management
Team management
 

KĂŒrzlich hochgeladen

Call Girls đŸ«€ Dwarka âžĄïž 9711199171 âžĄïž Delhi đŸ«Š Two shot with one girl
Call Girls đŸ«€ Dwarka âžĄïž 9711199171 âžĄïž Delhi đŸ«Š Two shot with one girlCall Girls đŸ«€ Dwarka âžĄïž 9711199171 âžĄïž Delhi đŸ«Š Two shot with one girl
Call Girls đŸ«€ Dwarka âžĄïž 9711199171 âžĄïž Delhi đŸ«Š Two shot with one girlkumarajju5765
 
Smarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxSmarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxolyaivanovalion
 
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779Delhi Call girls
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfadriantubila
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightDelhi Call girls
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxolyaivanovalion
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysismanisha194592
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxolyaivanovalion
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFxolyaivanovalion
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAroojKhan71
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxolyaivanovalion
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Delhi Call girls
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxolyaivanovalion
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfLars Albertsson
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusTimothy Spann
 
Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...shambhavirathore45
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...amitlee9823
 

KĂŒrzlich hochgeladen (20)

Call Girls đŸ«€ Dwarka âžĄïž 9711199171 âžĄïž Delhi đŸ«Š Two shot with one girl
Call Girls đŸ«€ Dwarka âžĄïž 9711199171 âžĄïž Delhi đŸ«Š Two shot with one girlCall Girls đŸ«€ Dwarka âžĄïž 9711199171 âžĄïž Delhi đŸ«Š Two shot with one girl
Call Girls đŸ«€ Dwarka âžĄïž 9711199171 âžĄïž Delhi đŸ«Š Two shot with one girl
 
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in  KishangarhDelhi 99530 vip 56974 Genuine Escort Service Call Girls in  Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
 
Smarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxSmarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptx
 
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptx
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptx
 
꧁❀ Aerocity Call Girls Service Aerocity Delhi ❀꧂ 9999965857 ☎ Hard And Sexy ...
꧁❀ Aerocity Call Girls Service Aerocity Delhi ❀꧂ 9999965857 ☎ Hard And Sexy ...꧁❀ Aerocity Call Girls Service Aerocity Delhi ❀꧂ 9999965857 ☎ Hard And Sexy ...
꧁❀ Aerocity Call Girls Service Aerocity Delhi ❀꧂ 9999965857 ☎ Hard And Sexy ...
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFx
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptx
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptx
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdf
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and Milvus
 
Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 

Sql saturday 829_decalogo_powerbi

  • 1. #sqlsat Progetto Power BI – Un Decalogo Lorenzo Vercellati
  • 2.
  • 3. Speaker  Business Intelligence Specialist @ SolidQ  Data Visualization Addicted  Speaker al SQL Saturday  DIAD Trainer  PBIUG Milan Administrator  @supergimi  lorenzovercellati
  • 4. Agenda  Centralizzare la DataSource  A ciascuno la sua dieta  Lavoriamo solo su misure  Calendar & Time Dimension from scratch  Filters Applied  A ciascuno il suo visual  Custom Topojson  Tips, Tricks & Tools  Buone letture
  • 6. Il Progetto BI DataSource ETL Flow Visuals Data Model
  • 7. Il Progetto PowerBI DataSource ETL Flow Visuals Data Model
  • 10. A Ciascuno la sua dieta
  • 12. Togliere ai Ricchi
 Tab XX A XX B YY A ZZ A ZZ C XX C YY C Diz XX YY ZZ XX YY Tab XX XX YY ZZ ZZ XX YY Tab A B A A C C C Diz A B A C Tab XX.A XX.B YY.A ZZ.A ZZ.C XX.C YY.C
  • 13. 
e dare ai Poveri Se non abbiamo Longitudine e Latitudine dobbiamo affidarci ai nomi dei luoghi geografici! I casi di omonimia geografica sono tantissimi e i servizi di geolocalizzazione di Bing non sempre rispondono a dovere. PiĂč informazioni gli diamo, piĂč facile sarĂ  il loro lavoro e piĂč precise saranno le risposte. Categorizziamo sempre le colonne geografiche.
  • 15. Lavoriamo solo su Misura Per il semplice fatto che Power BI ce le propone come misure, non significa che dobbiamo usare le colonne numeriche come misure nei visual!
  • 16. Lavoriamo solo su Misura  Creo le misure Base a partire dalle colonne numeriche ColValue TotaleValue TotaleValue PreviousYear Saldo vs PreviousYear % vs PreviousYear  Creo le misure Complesse a partire dalle misure Base  Nascondo le colonne
  • 17. Calendar and Time Dimension from scratch
  • 18. All You Need is Date Dim
  • 19. All You Need is Date Dim let StartDate = #date(StartYear,12,1), // EndDate = #date(EndYear,12,31), EndDate = Date.From(DateTime.LocalNow()), NumberOfDays = Duration.Days( EndDate - StartDate ), Dates = List.Dates(StartDate, NumberOfDays+1, #duration(1,0,0,0)), #"Converted to Table" = Table.FromList(Dates, Splitter.SplitByNothing(), null, null, ExtraValues.Error), #"Renamed Columns" = Table.RenameColumns(#"Converted to Table",{{"Column1", "FullDateAlternateKey"}}), #"Changed Type" = Table.TransformColumnTypes(#"Renamed Columns",{{"FullDateAlternateKey", type date}}), #"Inserted Year" = Table.AddColumn(#"Changed Type", "Year", each Date.Year([FullDateAlternateKey]), type number), #"Inserted Month" = Table.AddColumn(#"Inserted Year", "Month Number", each Date.Month([FullDateAlternateKey]), type number), #"Inserted Month Name" = Table.AddColumn(#"Inserted Month", "Month", each Date.MonthName([FullDateAlternateKey]), type text), #"Inserted Quarter" = Table.AddColumn(#"Inserted Month Name", "Quarter Number", each Date.QuarterOfYear([FullDateAlternateKey]), type number), #"Inserted Week of Year" = Table.AddColumn(#"Inserted Quarter", "Week of Year", each Date.WeekOfYear([FullDateAlternateKey]), type number), #"Inserted Week of Month" = Table.AddColumn(#"Inserted Week of Year", "Week of Month", each Date.WeekOfMonth([FullDateAlternateKey]), type number), #"Inserted Day" = Table.AddColumn(#"Inserted Week of Month", "Day", each Date.Day([FullDateAlternateKey]), type number), #"Inserted Day of Week" = Table.AddColumn(#"Inserted Day", "Day of Week Number", each Date.DayOfWeek([FullDateAlternateKey],1), type number), #"Inserted Day of Year" = Table.AddColumn(#"Inserted Day of Week", "Day of Year", each Date.DayOfYear([FullDateAlternateKey]), type number), #"Inserted Day Name" = Table.AddColumn(#"Inserted Day of Year", "Day of Week", each Date.DayOfWeekName([FullDateAlternateKey]), type text), #"Inserted Year Month" = Table.AddColumn(#"Inserted Day Name", "Year Month Number", each [Year] * 100 + [Month Number], type number), #"Inserted Year Month Name" = Table.AddColumn(#"Inserted Year Month", "Year Month", each Text.Combine({[Month], " ", Text.From([Year], "en-US")}), type text), #"Inserted Year Quarter" = Table.AddColumn(#"Inserted Year Month Name", "Year Quarter Number", each [Year] * 10 + [Quarter Number], type number), #"Inserted Quarter Name" = Table.AddColumn(#"Inserted Year Quarter", "Quarter", each Text.Combine({"Q", Text.From([Quarter Number], "en-US")}), type text), #"Inserted Year Quarter Name" = Table.AddColumn(#"Inserted Quarter Name", "Year Quarter", each Text.Combine({[Quarter], " ", Text.From([Year], "en-US")}), type text), #"Inserted Year Week" = Table.AddColumn(#"Inserted Year Quarter Name", "Year Week Number", each [Year] * 100 + [Week of Year], type number), #"Inserted Year Week Name" = Table.AddColumn(#"Inserted Year Week", "Year Week", each Text.Combine({"Week", " ", Text.From([Week of Year], "en-US"), " ", Text.From([Year], "en-US")}), type text), #"Renamed Columns1" = Table.RenameColumns(#"Inserted Year Week Name",{{"FullDateAlternateKey", "Date"}}) in #"Renamed Columns1"
  • 20. All You Need is Date Dim let SecondCount = 86400, Source = List.Times(#time(0, 0, 0),SecondCount, #duration(0,0,0,1)), TableFromList = Table.FromList(Source, Splitter.SplitByNothing()), ChangedType = Table.TransformColumnTypes(TableFromList,{{"Column1", type time}}), RenamedColumns = Table.RenameColumns(ChangedType,{{"Column1", "Time"}}), InsertHour = Table.AddColumn(RenamedColumns, "Hour", each Time.StartOfHour([Time])), InsertMinute = Table.AddColumn(InsertHour, "Minute", each Time.Minute([Time])), ChangedTypeHour = Table.TransformColumnTypes(InsertMinute,{{"Hour", type time}}), InsertQuarterHour = Table.AddColumn(ChangedTypeHour, "Quarter Hour", each if [Minute]<15 then [Hour] else if [Minute] < 30 then Value.Add([Hour],#duration(0,0,15, 0)) else if [Minute] < 45 then Value.Add([Hour],#duration(0,0,30, 0)) else Value.Add([Hour],#duration(0,0,45, 0))), ChangedTypeQtrHr = Table.TransformColumnTypes(InsertQuarterHour,{{"Quarter Hour", type time}}), ReorderedColumns = Table.ReorderColumns(ChangedTypeQtrHr,{"Time", "Hour", "Quarter Hour", "Minute"}), InsertHourNumber = Table.AddColumn(ReorderedColumns, "Hour Number", each Time.Hour([Time])), NextHour = Table.AddColumn(InsertHourNumber, "Next Hour", each Value.Add([Hour],#duration(0,1,0, 0))), NextQuarterHour = Table.AddColumn(NextHour, "Next Quarter Hour", each Value.Add([Quarter Hour],#duration(0,0,15, 0))), InsertPeriod = Table.AddColumn(NextQuarterHour, "Period of Day", each if [Hour Number] >= 0 and [Hour Number] < 4 then "After Midnight" else if [Hour Number] >= 4 and [Hour Number] < 8 then "Early Morning" else if [Hour Number] >= 8 and [Hour Number] < 12 then "Late Morning" else if [Hour Number] >= 12 and [Hour Number] < 16 then "Afternoon" else if [Hour Number] >= 16 and [Hour Number] < 20 then "Evening" else "Late Night"), InsertPeriodSort = Table.AddColumn(InsertPeriod, "PeriodSort", each if [Hour Number] >= 0 and [Hour Number] < 4 then 0 else if [Hour Number] >= 4 and [Hour Number] < 8 then 1 else if [Hour Number] >= 8 and [Hour Number] < 12 then 2 else if [Hour Number] >= 12 and [Hour Number] < 16 then 3 else if [Hour Number] >= 16 and [Hour Number] < 20 then 4 else 5), InsertTimeKey = Table.AddColumn(InsertPeriodSort, "TimeKey", each Time.ToText([Time], "HHmm"), type text) in InsertTimeKey
  • 22. Applied Filters: un po’ di Chiarezza
  • 23. Applied Filters: una Nuova Frontiera From: https://www.sqlbi.com/articles/displaying-filter-context-in-power-bi-tooltips/
  • 24. A ciascuno il suo Visual
  • 26. Anche l’occhio vuole la sua parte
 L’occhio umano non Ăš fatto per misurare gli angoli ma lunghezze e distanze. (cit. Alberto Cario, L’Arte Funzionale)
  • 27. Tools
  • 31. Tips
  • 33. Power Query Alert PowEr qUeRy Ăš CaSe sENsItivE
  • 34. PowerBi Dataflows I dataflows sono dataset condivisi? Per i dataflows serve Premium Storage? Posso combinare query su dataflows senza Premium Storage? NO! NO! NO
 
Anzi SI!
  • 36. 0 12 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 20 21 22 23 24 25 26 27 28 30 31 33 34 35 36 37 38 39 40 41 42 43 4 4 45 46 47 49 51 52 53 54 80 78 79 85 76 77 86 Customizzare Topojson Se non hai una mappa da convertire in topojson Se non hai alternative (QGIS), puoi sempre editare manualmente il file topojson che generata la mappa Topojson Ăš un sottotipo del geojson file type La struttura di un Topojson consistse in: Una lista di arcs (segmenti) Una lista di oggetti (poligoni) definiti da una sequenza ordinata e chiusa di segmenti
  • 37. 0 12 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 20 21 22 23 24 25 26 27 28 30 31 33 34 35 36 37 38 39 40 41 42 43 4 4 45 46 47 49 51 52 53 54 80 78 79 85 76 77 86 Customizzare Topojson Ogni Arc Ăš definito da un entry point e da una sequenza di punti. Ogni Arc ha una direzione definita Gli oggetti definiti da un arc con direzione opporta sono referenziati come –1 * (arc + 1) 76 -77
  • 39. Buone Letture PowerQuery Chriss Webb: https://blog.crossjoin.co.uk/ DAX SQLBI: https://www.sqlbi.com/articles/ PowerBI Reza Rad: http://radacad.com/blog Guy in a Cube: https://www.youtube.com/channel/UCFp1vaKzpfvoGai0vE5VJ0w Dataflows BI Polar: https://ssbipolar.com/2018/10/23/dataflows-in-power-bi/