0
0
Power BIbi_tool~10 mins

Line charts 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 create a line chart visual in Power BI using the 'Date' field on the axis.

Power BI
LineChart = LineChartVisual()
LineChart.Axis = [1]
Drag options to blanks, or click blank then click option'
ADate
BSales
CCategory
DRegion
Attempts:
3 left
💡 Hint
Common Mistakes
Using a measure like 'Sales' as the axis instead of a date field.
Choosing a categorical field that does not represent time.
2fill in blank
medium

Complete the DAX measure to calculate total sales for the line chart.

Power BI
TotalSales = CALCULATE(SUM(Sales[[1]]))
Drag options to blanks, or click blank then click option'
AAmount
BQuantity
CPrice
DDiscount
Attempts:
3 left
💡 Hint
Common Mistakes
Summing 'Quantity' instead of sales amount.
Using 'Price' which is unit price, not total sales.
3fill in blank
hard

Fix the error in the DAX formula to calculate running total sales over time.

Power BI
RunningTotal = CALCULATE(SUM(Sales[Amount]), FILTER(ALL(Sales[Date]), Sales[Date] [1] MAX(Sales[Date])))
Drag options to blanks, or click blank then click option'
A>
B=
C<=
D>=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '>' which excludes the current date.
Using '=' which only includes one date.
4fill in blank
hard

Fill both blanks to create a line chart that filters sales for the year 2023 and sums the amount.

Power BI
FilteredSales = CALCULATE(SUM(Sales[Amount]), FILTER(Sales, YEAR(Sales[[1]]) [2] 2023))
Drag options to blanks, or click blank then click option'
ADate
B=
C>
DRegion
Attempts:
3 left
💡 Hint
Common Mistakes
Using a non-date field like 'Region' in YEAR function.
Using '>' which filters for years after 2023, not equal.
5fill in blank
hard

Fill all three blanks to create a measure that calculates average sales per month for 2022.

Power BI
AvgSalesPerMonth = DIVIDE(CALCULATE(SUM(Sales[[1]]), FILTER(Sales, YEAR(Sales[[2]]) [3] 2022)), 12)
Drag options to blanks, or click blank then click option'
AAmount
BDate
C=
DQuantity
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Quantity' instead of 'Amount' for sales value.
Using '>' or '<' instead of '=' for year filter.