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

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
V-pazhen-msft
Community Support
Community Support

@Anonymous 

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
V-pazhen-msft
Community Support
Community Support

@Anonymous 

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

Greg_Deckler
Super User
Super User

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!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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