0
0
Power BIbi_tool~10 mins

Web data import in Power BI - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to import data from a web URL in Power BI.

Power BI
let
    Source = Web.Contents([1])
in
    Source
Drag options to blanks, or click blank then click option'
A"C:\Users\data.xlsx"
B"https://example.com/data.json"
CExcel.Workbook
DCsv.Document
Attempts:
3 left
💡 Hint
Common Mistakes
Using a local file path instead of a URL.
Forgetting to put the URL in quotes.
Using Excel or CSV functions instead of Web.Contents.
2fill in blank
medium

Complete the code to parse JSON data from a web source in Power BI.

Power BI
let
    Source = Web.Contents("https://api.example.com/data"),
    JsonData = Json.Document([1])
in
    JsonData
Drag options to blanks, or click blank then click option'
ASource
BCsv.Document(Source)
CExcel.Workbook(Source)
DWeb.Contents(Source)
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the URL string directly to Json.Document.
Using CSV or Excel functions on JSON data.
Calling Web.Contents inside Json.Document again.
3fill in blank
hard

Fix the error in the code to correctly import CSV data from a web URL.

Power BI
let
    Source = Web.Contents("https://example.com/data.csv"),
    CsvData = Csv.Document([1], [Delimiter=",", Encoding=1252])
in
    CsvData
Drag options to blanks, or click blank then click option'
A"https://example.com/data.csv"
BWeb.Contents
CCsv.Document
DSource
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the URL string instead of the content variable.
Calling Csv.Document without input.
Using Web.Contents inside Csv.Document.
4fill in blank
hard

Fill both blanks to convert web JSON data to a table and expand the 'items' column.

Power BI
let
    Source = Web.Contents("https://api.example.com/data"),
    JsonData = Json.Document(Source),
    TableData = Table.FromList([1], Splitter.SplitByNothing()),
    Expanded = Table.ExpandRecordColumn(TableData, "Column1", [2])
in
    Expanded
Drag options to blanks, or click blank then click option'
AJsonData[items]
B{"id", "name", "value"}
CJsonData
D["id", "name", "value"]
Attempts:
3 left
💡 Hint
Common Mistakes
Using curly braces instead of square brackets for column names.
Passing the whole JSON instead of the 'items' list.
Not expanding the record column properly.
5fill in blank
hard

Fill all three blanks to import XML data from a web URL and convert it to a table.

Power BI
let
    Source = Web.Contents([1]),
    XmlData = Xml.Tables([2]),
    TableData = XmlData[3]
in
    TableData
Drag options to blanks, or click blank then click option'
A"https://example.com/data.xml"
BSource
C{0}
DXmlData
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the URL string twice.
Using incorrect index to select the table.
Not using quotes around the URL.