Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
apohl1
Helper II
Helper II

Show "base" year in multi-year line chart

Hi all,

 

I would like to create a line chart as first chart below, one line showing revenue by month over two or more years, but I would like a second line in the chart that shows sales by month for a "base" year. "Base" year would be defined as 2017 sales. I am able to set this up for one year view (2nd chart) or alternaively add more lines to the 2nd chart to show additional years but that's not what I want. How do I create a measure that shows sales by month in a previous year (2017) that can be shown in the line chart below covering sales by month for years 2020-2021?

 

Thanks in advance!

 

1-27-2022 11-17-30 AM.jpg1-27-2022 11-17-02 AM.jpg

5 REPLIES 5
Whitewater100
Solution Sage
Solution Sage

Hi:

If I follow you, than your X axis should just be Month Name. Then each year (2020 & 2021) is a separate measure put on the chart.

To obtain the mixed line you can do something like:

 

Reference Line(Bal of 2017) = 
VAR = LastDatewithSales = Calculate(MAX(Sales[Order Date]), REMOVEFILTERS())
VAR = LineBalance = CALCULATE[2017 Sales], KEEPFILTERS(Dates[Date]) >= LastDatewithSales
return
LineBalance

 

This line would start where the grey line ends,assuming the grey line is 2021 and the year was not complete.

 

I hope this helps you.

amitchandak
Super User
Super User

@apohl1 , One is you select two years, Use month on axis and year on the legend 

 

second

you can use trailing measure use date table and time intelligence

 

Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))

 

Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),SAMEPERIODLASTYEAR('Date'[Date]))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you for the suggestion but I want x-axis to show Year-month (from 2020 and onwards) and base year sales should show 2017 sales by month and not previous year's sales (base year sales should be the same for April 2020 and April 2021). I hope this clarifies!

@apohl1 , Not very clear. 3 year behind

Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-3,Year))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

What I want to create is the red line in the chart below. The red line is the grey line continued as a reference point for all future years.  I hope this clarifies. 1-28-2022 2-29-18 PM.jpg

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.