9th Meeting
Power BI Module 0-1
9:00PM - September 1st, 2018
Lai Trung Minh Duc | DucLTM@outlook.com
Microsoft Student Partners Vietnam | Vietnam BI Community
Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 1
Agenda
• Module 0 – Introduction (Review in Meeting 8th)
• Module 1 - Power BI Desktop Data Transformations
• Changing Locale to current Location/Time-zone (for currency, timing)
• Connecting to Database/ Services/ Text files folder to get data
• Basic transformation
• Advanced transformation
• Relationship in Tables
Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 2
Agenda
• Module 1 - Power BI Desktop Data Transformations
• Enter Data
• Query Diagram Dependency
• Query Parameter
Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 3
Introduction
Lai Trung Minh Duc
Former External Economics student @ FTU
Former Solution Architect @ Savills Vietnam
Information Assurance student @ FPT
Tech-writer @ Duck’s Tech Zone
Full stack Developer @ Pizitech LTD.
Tech-trainer @ Microsoft Student Partners Vietnam
Tech-love: ASPNET Core, Python, Angular, Docker, SQL
Interests: Data Visualization, Data Analytics, Finance, Marketing
Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 4
Module 0
Power BI Overview
Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 5
Module 0 | Power BI Overview
Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 6
https://www.youtube.com/watch?v=YXTe_8-8EzE https://www.slideshare.net/MinhDucLaiTrung/2018
0826-8th-meeting-power-bi-orientation/
Module 1
Power BI Desktop Data Transformations
Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 7
Module 1 | Change Locale
• Purpose: Synchronize time-zone, currency,
date format, decimal delimiter with Data
source.
• (Ex: DD/MM/YYYY versus MM/DD/YYYY)
• Normally, Power BI take locale value of
current Windows system.
• Steps: File >> Options & Settings >> Options
Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 8
Module 1 | Connect to Database/Services
• File (6 connectors)
• Database (19 connectors)
• Power BI (1 connectors)
• Azure (11 connectors)
• Online Services (36 connectors)
• Other (12 connectors)
Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 9
https://docs.microsoft.com/en-us/power-
bi/desktop-data-sources
Module 1 | Power BI connectors
Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 10
SQL Database connector
Module 1 | Power BI connectors
Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 11
Excel connector
Module 1 | Power BI connectors
Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 12
CSV Text File connector
Module 1 | Power BI connectors
Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 13
Web Connector
Module 1 | Power BI connectors
| Explain Web Connector
• Anonymous (Public content)
• Windows (Active Directory control in LAN Company network)
• Basic (Username – Password)
• Web API (Header Token)
• Organizational Account (Login to get company resource)
Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 14
Module 1 | Power BI connectors
Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 15
Folder connector (for Excel, CSV, Text files,…)
Module 1 | Power BI connectors
Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 16
Microsoft Access connector
Module 1 | Power BI connectors
| Microsoft Access important note
Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 17
Microsoft Access connector
Module 1 |Navigator
Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 18
• Select Related Tables (check and
get relationship – related tables)
→ Relationship must be configured
in SQL Database.
• Load (Load directly to Data model)
• Edit (Popup the Power Query)
Module 1 | Demo Power BI Connector |
Navigator
• SQL Database
• Web Connector
• HTML Table: https://en.wikipedia.org/wiki/List_of_largest_cities
• JSON file: http://api.tvmaze.com/singlesearch/shows?q=mr-
robot&embed=episodes
• Navigator
Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 19
Module 1 | Basic Transformation
• Query
• Duplicate column
• Rename column
• Change data-type
• Data Filter
• Apply filter and Power BI will ask to reload the Data → After loading to Data model, use that data only
• Filter in Power Query (Power BI or Excel) is different from Filter in Excel Table (or Pivot Table)
Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 20
Module 1 | Advanced Transformation
• Date Extraction (Year, Month, Day, Hour, Minute, Second, Timezone,
DayOfWeek,…)
• Split column data (By length, by character)
• Conditional column (IF – THEN – ELSE IF – THEN – ELSE )
Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 21
Module 1 | Advanced Transformation
• Merge Query (Similar to JOIN in SQL):
• Left Outer
• Right Outer
• Full Outer
• Inner
• Left Anti
• Right Anti
• http://radacad.com/append-vs-merge-in-power-bi-and-power-query
Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 22
Module 1 | Advanced Transformation
• Append Query (Similar to UNION in SQL):
• If queries have same columns → Best scenario
• Else
→ Number of columns = number of same columns + number of different columns
→ Row will contain NULL value in some columns without data
• http://radacad.com/append-vs-merge-in-power-bi-and-power-query
Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 23
Module 1 | Relationship
• One-to-One
• One-to-Many
• Many-to-one
• Many-to-Many (simplify to One-to-many)
Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 24
Module 1 | Relationship
• One-to-One
• One-to-Many
• Many-to-one
• Many-to-Many (simplify to One-to-many)
https://docs.microsoft.com/en-us/power-bi/desktop-create-and-manage-
relationships
Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 25
Module 1 | Enter Data
• Copy data from Excel without using connecting feature
• Self typing the data
Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 26
Module 1 | Query Dependency View
• View the dependent of each query (where does the value come from?)
Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 27
Module 1 | Query Parameter
• Filter Power Query data by end-user
• Predefined value for columns
Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 28
https://www.youtube.com/watch?v=0B3kmAsEJHY
QUIZ
Any help?
Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 29
THANK YOU
DucLTM@outlook.com
Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 30

20180901 - 9th Meeting - Power BI Module 0-1

  • 1.
    9th Meeting Power BIModule 0-1 9:00PM - September 1st, 2018 Lai Trung Minh Duc | DucLTM@outlook.com Microsoft Student Partners Vietnam | Vietnam BI Community Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 1
  • 2.
    Agenda • Module 0– Introduction (Review in Meeting 8th) • Module 1 - Power BI Desktop Data Transformations • Changing Locale to current Location/Time-zone (for currency, timing) • Connecting to Database/ Services/ Text files folder to get data • Basic transformation • Advanced transformation • Relationship in Tables Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 2
  • 3.
    Agenda • Module 1- Power BI Desktop Data Transformations • Enter Data • Query Diagram Dependency • Query Parameter Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 3
  • 4.
    Introduction Lai Trung MinhDuc Former External Economics student @ FTU Former Solution Architect @ Savills Vietnam Information Assurance student @ FPT Tech-writer @ Duck’s Tech Zone Full stack Developer @ Pizitech LTD. Tech-trainer @ Microsoft Student Partners Vietnam Tech-love: ASPNET Core, Python, Angular, Docker, SQL Interests: Data Visualization, Data Analytics, Finance, Marketing Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 4
  • 5.
    Module 0 Power BIOverview Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 5
  • 6.
    Module 0 |Power BI Overview Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 6 https://www.youtube.com/watch?v=YXTe_8-8EzE https://www.slideshare.net/MinhDucLaiTrung/2018 0826-8th-meeting-power-bi-orientation/
  • 7.
    Module 1 Power BIDesktop Data Transformations Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 7
  • 8.
    Module 1 |Change Locale • Purpose: Synchronize time-zone, currency, date format, decimal delimiter with Data source. • (Ex: DD/MM/YYYY versus MM/DD/YYYY) • Normally, Power BI take locale value of current Windows system. • Steps: File >> Options & Settings >> Options Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 8
  • 9.
    Module 1 |Connect to Database/Services • File (6 connectors) • Database (19 connectors) • Power BI (1 connectors) • Azure (11 connectors) • Online Services (36 connectors) • Other (12 connectors) Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 9 https://docs.microsoft.com/en-us/power- bi/desktop-data-sources
  • 10.
    Module 1 |Power BI connectors Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 10 SQL Database connector
  • 11.
    Module 1 |Power BI connectors Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 11 Excel connector
  • 12.
    Module 1 |Power BI connectors Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 12 CSV Text File connector
  • 13.
    Module 1 |Power BI connectors Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 13 Web Connector
  • 14.
    Module 1 |Power BI connectors | Explain Web Connector • Anonymous (Public content) • Windows (Active Directory control in LAN Company network) • Basic (Username – Password) • Web API (Header Token) • Organizational Account (Login to get company resource) Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 14
  • 15.
    Module 1 |Power BI connectors Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 15 Folder connector (for Excel, CSV, Text files,…)
  • 16.
    Module 1 |Power BI connectors Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 16 Microsoft Access connector
  • 17.
    Module 1 |Power BI connectors | Microsoft Access important note Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 17 Microsoft Access connector
  • 18.
    Module 1 |Navigator LaiTrung Minh Duc | Sept 2018 | DucLTM@outlook.com 18 • Select Related Tables (check and get relationship – related tables) → Relationship must be configured in SQL Database. • Load (Load directly to Data model) • Edit (Popup the Power Query)
  • 19.
    Module 1 |Demo Power BI Connector | Navigator • SQL Database • Web Connector • HTML Table: https://en.wikipedia.org/wiki/List_of_largest_cities • JSON file: http://api.tvmaze.com/singlesearch/shows?q=mr- robot&embed=episodes • Navigator Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 19
  • 20.
    Module 1 |Basic Transformation • Query • Duplicate column • Rename column • Change data-type • Data Filter • Apply filter and Power BI will ask to reload the Data → After loading to Data model, use that data only • Filter in Power Query (Power BI or Excel) is different from Filter in Excel Table (or Pivot Table) Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 20
  • 21.
    Module 1 |Advanced Transformation • Date Extraction (Year, Month, Day, Hour, Minute, Second, Timezone, DayOfWeek,…) • Split column data (By length, by character) • Conditional column (IF – THEN – ELSE IF – THEN – ELSE ) Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 21
  • 22.
    Module 1 |Advanced Transformation • Merge Query (Similar to JOIN in SQL): • Left Outer • Right Outer • Full Outer • Inner • Left Anti • Right Anti • http://radacad.com/append-vs-merge-in-power-bi-and-power-query Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 22
  • 23.
    Module 1 |Advanced Transformation • Append Query (Similar to UNION in SQL): • If queries have same columns → Best scenario • Else → Number of columns = number of same columns + number of different columns → Row will contain NULL value in some columns without data • http://radacad.com/append-vs-merge-in-power-bi-and-power-query Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 23
  • 24.
    Module 1 |Relationship • One-to-One • One-to-Many • Many-to-one • Many-to-Many (simplify to One-to-many) Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 24
  • 25.
    Module 1 |Relationship • One-to-One • One-to-Many • Many-to-one • Many-to-Many (simplify to One-to-many) https://docs.microsoft.com/en-us/power-bi/desktop-create-and-manage- relationships Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 25
  • 26.
    Module 1 |Enter Data • Copy data from Excel without using connecting feature • Self typing the data Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 26
  • 27.
    Module 1 |Query Dependency View • View the dependent of each query (where does the value come from?) Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 27
  • 28.
    Module 1 |Query Parameter • Filter Power Query data by end-user • Predefined value for columns Lai Trung Minh Duc | Sept 2018 | DucLTM@outlook.com 28 https://www.youtube.com/watch?v=0B3kmAsEJHY
  • 29.
    QUIZ Any help? Lai TrungMinh Duc | Sept 2018 | DucLTM@outlook.com 29
  • 30.
    THANK YOU DucLTM@outlook.com Lai TrungMinh Duc | Sept 2018 | DucLTM@outlook.com 30