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

Line Not Showing Month Totals for Year Before

Hello all,

 

So I have year over year cumulative totals showing on a Line Chart and I cannot figure out how to show all month totals for previous years even though we are only in August. I would like to see the whole year's months so I can see how we did last year during November for example. Is there anything I can do here? 

Thank you!

Capture.JPG

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Amy,

 

I have figured out my issue. Because my calendar table did not have any dates past today's date, the chart would not show future dates. The red line is still cummulative but it becomes constant because there has been nothing sold past the current date. Thank you for your help!

Capture.GIF

View solution in original post

5 REPLIES 5
v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

You may create calendar table first of all, create relationship between your data table and calendar table on date field, then create measures like DAX below.

 

DateDim= CALENDARAUTO()
 
This Year= TOTALYTD(SUM(Table1[Sales]),'DateDim'[Date])
 
Last Year = CALCULATE(SUM(Table1[Sales]),DATEADD('DateDim'[Date],-1,YEAR))
 
2 Year ago = CALCULATE(SUM(Table1[Sales]),DATEADD('DateDim'[Date],-2,YEAR))
 
3 Year ago = CALCULATE(SUM(Table1[Sales]),DATEADD('DateDim'[Date],-3,YEAR))
 
4 Year ago = CALCULATE(SUM(Table1[Sales]),DATEADD('DateDim'[Date],-4,YEAR))

Or could you please share your sample data and desired output screenshots for further analysis? You can also upload sample pbix to OneDrive and post the link here. Do mask sensitive data before uploading.

 

Best Regards,

Amy

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Anonymous
Not applicable

Amy,

 

I have figured out my issue. Because my calendar table did not have any dates past today's date, the chart would not show future dates. The red line is still cummulative but it becomes constant because there has been nothing sold past the current date. Thank you for your help!

Capture.GIF

Anonymous
Not applicable

Hello Amy, 

 

Thank you for your response, I was creating a PowerBI with example data to show you the issue I am having and it set up perfectly with no issues. It is showing the whole previous year cumulative total. I am going to rewrite my formulas and try again in my original doc today. I think I must have a filter on that is messing up the visual. Untitled.png

Thank you for your help!

Anonymous
Not applicable

If I change the year to 2018 then all the data shows up for that year and the year before since there was data already for 2018, so I am thinking it's just because my calendar table is only up until today. 

Hi @Anonymous ,

 

Can you load the pbix to Google or OneDrive and share the link to find a solution.

 

 

Cheers

 

CheenuSing

Did I answer your question? Mark my post as a solution and also give KUDOS !

Proud to be a Datanaut!

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.