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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jcary02
Frequent Visitor

DAX help: Show Sales YOY, but show the current year overlaid on the entire previous year

I'd like to reproduce a graph similar to the second one shown below in Power BI. I have measures for the current year and sameday last year.  I'm having trouble projecting my last year measure into the future.

 

Basically, I want to show the same period last year for a future date. I have the data just can't get it to overlay.  Any advise would be awesome!

 

This is an example of what I have so far in Power BI:

jcary02_1-1593810480446.png

 

What I want to acheive is shown below. The blue line is the current year which ends today. the gray line is same period last year for but for a future date:

jcary02_0-1593793985253.png

 

1 ACCEPTED SOLUTION

sorry I meant "put the date from the dates table minus the year component on the x axis".  Calculated column is enough.

 

you need to strip the year from the date column, and then use the year as legend (the way you already did)

View solution in original post

6 REPLIES 6
lbendlin
Super User
Super User

put the date from the dates table (not the facts table) on the x axis and then select "show items with no data".

Ok, I have the date from my dimension table on the x axis. Where can I find the 'show items with no data' option?

click the triangle next to the date field in the visual's axis section

Shoot, that didn't work. My date dimension goes until 2025, but when I select the 'show item with no data' option nothing changes. 

sorry I meant "put the date from the dates table minus the year component on the x axis".  Calculated column is enough.

 

you need to strip the year from the date column, and then use the year as legend (the way you already did)

Thank you! Got it!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors