Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

How to do YoY comparison broken down by month with COUNT calculation?

Hello Community!

 

Hopefully someone can rescue me on this one! 

 

I have data like this:

DateFull Name
12/08/2022Ms Vicky Castillo
17/03/2021Mr Mark Molloy
05/01/2022Ms Michaela Synnott
09/10/2021Ms Heli Mooney
05/08/2021Mrs Karen Herbert



I would like to COUNT how many people there are for each month (I don't care about the day or time, exactly) and then display this on a bar chart. 
However, this bar chart needs to also display a bar chart for each month, but for the previous year! 
I want to see how many people there are, for example, in January 2022 and at the same time how many there were on January, but of last year. 

Eventually, I would get something like this:

anonymous002_0-1660551163471.png

 



1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

You could create two measures .I tested a simple file:

 

Total sales LY = CALCULATE(SUM(financials[ Sales]),FILTER(ALL(financials),EOMONTH([Date],0)=EOMONTH(MAX('financials'[Date]),-12)))
%change = DIVIDE(SUM([ Sales]),[Total sales LY])-1

 

The final show:

AilsaTao_11-1660799931083.png


Best Regards,
Community Support Team _ Yalan Wu
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-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

You could create two measures .I tested a simple file:

 

Total sales LY = CALCULATE(SUM(financials[ Sales]),FILTER(ALL(financials),EOMONTH([Date],0)=EOMONTH(MAX('financials'[Date]),-12)))
%change = DIVIDE(SUM([ Sales]),[Total sales LY])-1

 

The final show:

AilsaTao_11-1660799931083.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

davehus
Memorable Member
Memorable Member

Hi @Anonymous ,

 

Are you looking for something like new or returning customers? If so @marcorusso has a great blog on this. See link below. DAX Patterns: New and returning customers - SQLBI

 

D

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.