Complete the code to create a line chart visual in Power BI using the 'Date' field on the axis.
LineChart = LineChartVisual()
LineChart.Axis = [1]The axis of a line chart typically uses a time or sequential field like 'Date' to show trends over time.
Complete the DAX measure to calculate total sales for the line chart.
TotalSales = CALCULATE(SUM(Sales[[1]]))The 'Amount' column usually holds the sales value to sum for total sales.
Fix the error in the DAX formula to calculate running total sales over time.
RunningTotal = CALCULATE(SUM(Sales[Amount]), FILTER(ALL(Sales[Date]), Sales[Date] [1] MAX(Sales[Date])))To calculate running total, include all dates less than or equal to the current date, so use '<='.
Fill both blanks to create a line chart that filters sales for the year 2023 and sums the amount.
FilteredSales = CALCULATE(SUM(Sales[Amount]), FILTER(Sales, YEAR(Sales[[1]]) [2] 2023))
The filter should use the 'Date' column and check if the year equals 2023.
Fill all three blanks to create a measure that calculates average sales per month for 2022.
AvgSalesPerMonth = DIVIDE(CALCULATE(SUM(Sales[[1]]), FILTER(Sales, YEAR(Sales[[2]]) [3] 2022)), 12)
The measure sums 'Amount' filtered by 'Date' where year equals 2022, then divides by 12 months.