SlideShare une entreprise Scribd logo
1  sur  40
Télécharger pour lire hors ligne
#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!

Contenu connexe

Similaire à 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
 

Similaire à 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
 

Plus 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
 

Plus 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
 

Dernier

Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfRachmat Ramadhan H
 
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
 
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfKantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfSocial Samosa
 
Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystSamantha Rae Coolbeth
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...Suhani Kapoor
 
Data Science Project: Advancements in Fetal Health Classification
Data Science Project: Advancements in Fetal Health ClassificationData Science Project: Advancements in Fetal Health Classification
Data Science Project: Advancements in Fetal Health ClassificationBoston Institute of Analytics
 
RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfgstagge
 
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPramod Kumar Srivastava
 
Data Warehouse , Data Cube Computation
Data Warehouse   , Data Cube ComputationData Warehouse   , Data Cube Computation
Data Warehouse , Data Cube Computationsit20ad004
 
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Callshivangimorya083
 
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptxEMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptxthyngster
 
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...shivangimorya083
 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...Suhani Kapoor
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Call Girls In Noida City Center Metro 24/7✡️9711147426✡️ Escorts Service
Call Girls In Noida City Center Metro 24/7✡️9711147426✡️ Escorts ServiceCall Girls In Noida City Center Metro 24/7✡️9711147426✡️ Escorts Service
Call Girls In Noida City Center Metro 24/7✡️9711147426✡️ Escorts Servicejennyeacort
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptSonatrach
 

Dernier (20)

Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
 
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
 
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfKantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
 
Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data Analyst
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
E-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptxE-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptx
 
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
 
Data Science Project: Advancements in Fetal Health Classification
Data Science Project: Advancements in Fetal Health ClassificationData Science Project: Advancements in Fetal Health Classification
Data Science Project: Advancements in Fetal Health Classification
 
RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdf
 
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
 
Data Warehouse , Data Cube Computation
Data Warehouse   , Data Cube ComputationData Warehouse   , Data Cube Computation
Data Warehouse , Data Cube Computation
 
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
 
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptxEMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
 
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
 
Russian Call Girls Dwarka Sector 15 💓 Delhi 9999965857 @Sabina Modi VVIP MODE...
Russian Call Girls Dwarka Sector 15 💓 Delhi 9999965857 @Sabina Modi VVIP MODE...Russian Call Girls Dwarka Sector 15 💓 Delhi 9999965857 @Sabina Modi VVIP MODE...
Russian Call Girls Dwarka Sector 15 💓 Delhi 9999965857 @Sabina Modi VVIP MODE...
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
 
Call Girls In Noida City Center Metro 24/7✡️9711147426✡️ Escorts Service
Call Girls In Noida City Center Metro 24/7✡️9711147426✡️ Escorts ServiceCall Girls In Noida City Center Metro 24/7✡️9711147426✡️ Escorts Service
Call Girls In Noida City Center Metro 24/7✡️9711147426✡️ Escorts Service
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
 

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/