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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Creating a Y-1 graph without showing previous periods on X axis.

Hello , as per the below screenshot i am trying to create a graph where i can show the Y-1 values as well as the last 12 months values however i am unable to remove the previous periods from the graph with a slicer or with filters, when i do so i lose the values for Y-1, can anyone possibly assist me with this? Many thanks

 

Samoeapharma_0-1646733623441.png

 

4 REPLIES 4
amitchandak
Super User
Super User

@Anonymous , Based on what I got , a measure like this should help

 

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
Anonymous
Not applicable

Hello Amtichandak, indeed i have used the second formula you have mentioned however what i am looking to do i hide the 2020 values on my x axis and i am unable to do so with filtering or slicing as this will remove the values on the orange line (the Y-1 line)

Anonymous
Not applicable

Hi @Anonymous ,

Which field of which table is applied to the x-axis on your line chart visual? Is it from the date dimension table? Is it possible to try to apply a visual-level filter in Filters panel with the condition (date>=2021.1.1)?

If the above one is not working, please provide some data of involved tables which applied on the line chart visual and the Fields setting of line chart visual. And please also share the related formulas if it involve any measure. Thank you.

Best Regards

@Anonymous , For that use a year slicer

 

Or filter using a column like

Year Type = Switch( True(),
year([Date])= year(Today()),"This Year" ,
year([Date])= year(Today())-1,"Last Year" ,
Format([Date],"YYYY")
)

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.