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

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
Community Champion
Community Champion

@Anonymous 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 on linkedin

View solution in original post

6 REPLIES 6
negi007
Community Champion
Community Champion

@Anonymous 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 on linkedin

Anonymous
Not applicable

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 on linkedin

Anonymous
Not applicable

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

@Anonymous , 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-YTD-LYTD-Week-Over-Week/m-p/1051626#M184


Appreciate your Kudos.

Anonymous
Not applicable

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
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.