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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
bsz412
Helper III
Helper III

Bar chart calendar on x axis, how to hide year

Hi, 

 

On this visual, I should hide the year, and leave only the month. If I just add current year data it works, but I have 2 bars: current year and last year, and if I add only the months to X-axis, visual breaks as it cannot find the previous year data

 

bsz412_1-1656674880340.png

It looks like this now: 

bsz412_0-1656674805713.png

 

And I would need the same without showing the years "2021' and "2022".

Is there any simple way to fix that?

thank you!

1 REPLY 1
amitchandak
Super User
Super User

@bsz412 , You create a measure and filter this year's data in case that is objective. If measures are this year vs last year

 

This year Today =
var _min = eomonth(today(),-1*month(today()))+1
var _max = eomonth(_min,11)
return
CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))

 

 

last year measure

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

 

 

Make sure the first one is used as a filter too (Visual level)

 

You can also go to the next level using the drill menu. As of now, you have used expand. Use parallel line

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

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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