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

YOY data comparison - day by day chart

I have 2020 (year to date) data and 2019 sales data loaded into Power Bi. I want to overlay the 2 years data over each other in a line graph. It works fine on a continuous line (1 Jan 2019 to 30 April 2020), but if I want to overlap, i.e. one line for 2019 data (1 Jan to 31 Dec) and a parallel line for 2020 data (till April), it works only for quarterly or monthly view. When I drill down to day by day view, it sums up 1st of every month, 2nd of every month etc.

 

Is it possible to chart 1 January, 2 Janauary .... 31 December on X axis and Sales data for 2019 and 2020 on Y axis. I tried using Calendar function and Samedaypreviousyear function, but did not get the desired result.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: YOY data comparison - day by day chart

@dark_horizon 

Try use this measure instead of Sales column as value. 

 

 

Sales Measure = CALCULATE(SUM('Table'[Sales]),FILTER(ALL('Table'),SUMX(FILTER('Table',EARLIER('Table'[Date].[Year])=[Date].[Year] && EARLIER('Table'[Date].[Month])=[Date].[Month]&&EARLIER('Table'[Date].[Day])=[Date].[Day]),1)))

 

 

dirll down.JPG

 

Then turn on the drill down button, and click on the value point on the line chart to drill down to the respective month days. 

 

Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

2 REPLIES 2
Highlighted
Super User IX
Super User IX

Re: YOY data comparison - day by day chart

Could be wrong, but try using the forked arrows to drill into the data instead of the parallel arrows.


---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Highlighted
Community Support
Community Support

Re: YOY data comparison - day by day chart

@dark_horizon 

Try use this measure instead of Sales column as value. 

 

 

Sales Measure = CALCULATE(SUM('Table'[Sales]),FILTER(ALL('Table'),SUMX(FILTER('Table',EARLIER('Table'[Date].[Year])=[Date].[Year] && EARLIER('Table'[Date].[Month])=[Date].[Month]&&EARLIER('Table'[Date].[Day])=[Date].[Day]),1)))

 

 

dirll down.JPG

 

Then turn on the drill down button, and click on the value point on the line chart to drill down to the respective month days. 

 

Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Upcoming Events

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors