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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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]))

 

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")
)

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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