cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
amrashrafyw
Helper III
Helper III

compare specific last year month values to current year months

Hello,

I have a requirement to compare the count of tickets this year month by month to the count of tickets in December 2019,

so the final result looks like 

baseline.png

and the value of December 2019 to be affected by filters like Country, city,... as if the user needs to compare the number of tickets in the same city in December 2019 to current month for example, anyhelp?

1 ACCEPTED SOLUTION
negi007
Super User
Super User

@amrashrafyw Yes it is possible to achive. Follow below steps

 

1. Create a measure to sum Dec'19 total

Dec'19 = CALCULATE(SUM(P1&P2),'Calendar'[Year]=2019,month('Calendar'[Date])=12)

 
2. Use Column Cluster Chart
in values put, Dec'19 and sum(P1&P2), In Axis put date Month and Apply filter to Year = 2020
 
Final output is below

Monthly_Chart.PNG

 
 



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


Proud to be a Super User!

Follow me here


View solution in original post

6 REPLIES 6
negi007
Super User
Super User

@amrashrafyw Yes it is possible to achive. Follow below steps

 

1. Create a measure to sum Dec'19 total

Dec'19 = CALCULATE(SUM(P1&P2),'Calendar'[Year]=2019,month('Calendar'[Date])=12)

 
2. Use Column Cluster Chart
in values put, Dec'19 and sum(P1&P2), In Axis put date Month and Apply filter to Year = 2020
 
Final output is below

Monthly_Chart.PNG

 
 



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


Proud to be a Super User!

Follow me here


View solution in original post

thanks for your reply, I've done your steps and when I put a filter on the graph to show only months in 2020 the dec'19 measure disappear and it make sense as the date filter applied on the measure itself point to month in 2019 not 2020

@amrashrafyw I'm not sure why it doesn't work. Take a look at the next time. If you're still having trouble, please share your details and then it will help you more.

negi007_0-1601480558255.png




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


Proud to be a Super User!

Follow me here


I've tried it again but added ,ALL('date'[Start of Month])) to be like:

Dec'19 = CALCULATE([P1 & P2],'date'[Year]=2019,'date'[Month]=12,ALL('date'[Start of Month]))
amitchandak
Super User
Super User

@amrashrafyw , With a date table

 

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))

last year MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-12,MONTH)))

last year MTD (complete) Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-12,MONTH))))

Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions

See if my webinar on Time Intelligence can help: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-Y...


Appreciate your Kudos.

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin

Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!

thanks for your reply, but those measures won't help.

what is required to be implemented: I want to have a column next to each month as shown in the graph,  having the count of tickets in December 2019 and change with filters except the date filter

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

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