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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
YmmotEul
Frequent Visitor

Selected only data from 2023, but i would like to have full 2022 years to always be shown on chart

Dear experts, I woud like to build a chart for powerBI. (in the illustration at the bottom of message)

It has X-axis is the month, and Y-axis is the dollar.  
3 column of data are
- Cost (in million)
- Cost Ratio 
- Target Cost

These were recorded for 3 countries: Japan, Brazil and China. 
These were recorded for full year 2022 (from jan - Dec), and up till February Data actual data. 
Below visualisation is what i wanted to achieve, as i will have a Slicer to filter full year 2023, but i am unable to place full year 2022 to be visualised in the chart in powerbI once i used the slicer to filter the dates in 2023.  

If i selected 2022 and 2023 in the filter, it resulted in a sharp decline from Dec 2023 to Jan 2023 due to the continuation of the date. 

In summary, i wanted the X axis to only show 2023 from jan to dec, but i also want to show full data of the cost(million) for the full year 2022. When i selected the filter for 2022 and 2023 for the time, i was unable to achieve what i want in the illustration. 

Thanks for assisting! Here is the file : Database excel file

 

 

powerbi help.png

1 REPLY 1
amitchandak
Super User
Super User

@YmmotEul , In case you have date table, last year's ytd

Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))

 

For 2023 measure you can consider

How to get a single continuous line for Actual and Target without any break: https://youtu.be/41yhZz2pNTI

 

Last year

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

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors