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

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.