cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GD61 Member
Member

Graph with Sales 2014 and Sales 2013 on the same axis

Hello,

I have only one column of Dates and one column of Sales.

How do you built a graph with sales of 2 years on the same axis like this one :

 

ScaleMonth.gif

 

Thanks for your help

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Graph with Sales 2014 and Sales 2013 on the same axis

Make sure you have selected Clustered Column Chart.  Put Month on Axis, Year on Legend.


Here is a sample workbook. https://www.dropbox.com/s/ul1fj7yqzvn74xd/2%20years.pbix?dl=0



* Matt is a Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

View solution in original post

5 REPLIES 5
Highlighted
Super User
Super User

Re: Graph with Sales 2014 and Sales 2013 on the same axis

I assume you have both of these columns in 1 table.  Create a second table "Calendar" and put a column of dates (same date range as your sales table) and then add a column called "Year" that just contains the year for each date.  Join the date column in your Sales table to the date column in your calendar table.  Then put the Year column from the calendar table on Axis to get the result.  You can also add a column for Month, Quarter, Week, Day Name etc to extend your calendar table so it becomes more useful for different reporting needs.



* Matt is a Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
GD61 Member
Member

Re: Graph with Sales 2014 and Sales 2013 on the same axis

Hi,

I still have two issues:

  • I have only one column for each month, which is the total of 2015 and 2016 years. I expected two column on each month, one for 2015 and the other for 2016.
  • Monyhs are sorted by decreasing amount. The Sort by...Month_Tx doesn't work

What did I miss?

 Monthly Amount.jpg

 

Super User
Super User

Re: Graph with Sales 2014 and Sales 2013 on the same axis

Make sure you have selected Clustered Column Chart.  Put Month on Axis, Year on Legend.


Here is a sample workbook. https://www.dropbox.com/s/ul1fj7yqzvn74xd/2%20years.pbix?dl=0



* Matt is a Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

View solution in original post

Niels_NL Regular Visitor
Regular Visitor

Re: Graph with Sales 2014 and Sales 2013 on the same axis

It might be more of a workaround, but it worked for me when I was having the same issue as you.

You could also create three tables:

  • Date table with 'date', 'month', 'year', etc.
  • Sales 2013 table
  • Sales 2014 table

Then create some relations between the dates in sales2013 and sales2014 and your date table. Like this:

  • Sales 2013 [date] --> Date [date]
  • Sales 2014 [date] --> Date [date]  

Make sure the dates in the date-table are of a unique value, so you can properly filter on them. 

 

Then create a barchart, insert the total € of sales 2013 and sales 2014 in the value-field. And the month_name (from the date-table) in the axis-value.

 

After that you could create a slicer to filter on year, month, quartile or whatever you want to filter on.

GD61 Member
Member

Re: Graph with Sales 2014 and Sales 2013 on the same axis

Hi MAllington, 

Thanks a lot! 

That works!

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 57 members 1,210 guests
Please welcome our newest community members: