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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
saadat_rda
Frequent Visitor

Showing two years of financial data on same graph

Hi ,

 

I would like to show  YTD revenue figures for this year, last year and target on the same line chart.

When I try to pull last year data, PowerBI treats it as one continuous dataset as all dates are coming from a date table.

 

This is what I have. I just

saadat_rda_1-1679626823637.png

 

the DAX used to calculate YTD values is:

YTD_Billed = CALCULATE(SUM(FY23[InvoiceAmount]),DATESYTD('Fiscal Year Table'[Date],"06/30"))
YTD_Billed22 = CALCULATE(SUM(FY22[InvoiceAmount]),DATESYTD('Fiscal Year Table'[Date],"06/30"))
Target YTD = CALCULATE([Target],DATESYTD('Fiscal Year Table'[Date],"06/30"))
 
How can I show the graphs overlapping each other instead of a coninuous time frame as showin in my graph?
 

Please note, I am operating in direct query mode hence calcualted columns are not an option for me.

 

3 REPLIES 3
saadat_rda
Frequent Visitor

@rajulshah almost but not quite there.

 

The DAX you provided results in the billow visual.

I think this is because the revenue for each year resides in two seperate tables.

So i have a table called FY23 and another called FY22. I think the sameperiodlastyear function checks for datafrom the last year in FY23 table, except there isn't any? and for some reason it's spitting it out as FY24 instead.

 

saadat_rda_0-1679646011852.png

 

Not sure, that could be the reason.

rajulshah
Resident Rockstar
Resident Rockstar

@saadat_rda 

 

You can create a measure as follows:

YTD_Billed22 = CALCULATE ( [YTD_Billed] , SAMEPERIODLASTYEAR ( 'Fiscal Year Table' [ Date ] ) )

Please let me know if this didn't work.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.