SlideShare una empresa de Scribd logo
1 de 40
Descargar para leer sin conexión
#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!

Más contenido relacionado

Similar a 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
 
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
 

Similar a 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
 

Más de 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 - 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
 

Más de 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
 

Último

Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangaloreamitlee9823
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceDelhi Call girls
 
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
 
Probability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter LessonsProbability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter LessonsJoseMangaJr1
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfMarinCaroMartnezBerg
 
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...amitlee9823
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...amitlee9823
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Valters Lauzums
 
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
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...amitlee9823
 
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
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteedamy56318795
 
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night StandCall Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...amitlee9823
 

Último (20)

Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
 
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
 
Probability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter LessonsProbability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter Lessons
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 
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
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
 
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
 
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...
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night StandCall Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
 
Sampling (random) method and Non random.ppt
Sampling (random) method and Non random.pptSampling (random) method and Non random.ppt
Sampling (random) method and Non random.ppt
 
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
 

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/