Suppose I have a table which is containing data for 2 years like for 2021 and 2022 and I want to show data in line chart with 2021 data into solid line and for 2022 in dotted in a single chart
1 Answer
You might want to use the SAMEPERIODLASTYEAR DAX function.
Using it, you could create two measures such as
TotalSales = SUM(Sales[SalesAmount]) PreviousYearTotalSales = CALCULATE( SUM(Sales[SalesAmount]), SAMEPERIODLASTYEAR(Date[Date])) and plot those out on your linechart