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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
RichOB
Post Partisan
Post Partisan

Need help with measure for % change from previous month

Hi, I'm looking for help with a measure that will show the monthly % change from the previous month. For example, from the table data, I want the measure to show:

January (4 new starters) = I'm guessing this will be a 0 as it's the starting point?

February (3 new starters) = -25%

March (6 new starters) = 100%

 

LocationDate New Employees
London01/01/20241
London01/01/20241
London01/01/20241
London01/01/20241
London01/02/20241
London01/02/20241
London01/02/20241
London01/03/20241
London01/03/20241
London01/03/20241
London01/03/20241
London01/03/20241
London01/03/20241

 

Thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, drx .thanks for your concern about this issue.

Your answer is excellent!
And I would like to share some additional solutions below.

Hello,@RichOB .I am glad to help you.

I hope my test below helps you.

If the date in your real data is fixed to the beginning of each month (the first of each month)
then you can write a measure based on the change in date.

Proportion of monthly increments = 
VAR _monthCount=CALCULATE(COUNT('Table'[New Employees]),ALLEXCEPT('Table','Table'[Date]))
VAR _date =MAX('Table'[Date])
VAR _previousDate=EOMONTH(_date,-2)+1
VAR _previousToThis=CALCULATE(COUNT('Table'[New Employees]),FILTER(ALL('Table'),'Table'[Date]=_previousDate))
VAR _differ= _monthCount-_previousToThis
VAR _NumPercent=DIVIDE(_differ,_previousToThis)
RETURN
IF(ISBLANK(_NumPercent),
0,
_NumPercent)

 

vjtianmsft_0-1730954405309.png

If your dates are not fixed (fixed to the first day of the month), I recommend that you start by grouping by date.

Sort and group the dates by power query to generate an index column.

1. Group all rows according to the date column.

vjtianmsft_1-1730954472105.png

vjtianmsft_2-1730954478362.png

create index column

vjtianmsft_3-1730954504923.png

3. Expand the table

vjtianmsft_4-1730954541206.png

Calculated based on the change in the index column measure
index-1 is the previous date to the current date

vjtianmsft_5-1730954566061.png

M_index = 
VAR _monthCount=CALCULATE(COUNT('Table'[New Employees]),ALLEXCEPT('Table','Table'[Date]))
VAR _index=MAX('Table'[Index])
VAR _previousIndex=_index -1
VAR _previousToThis=CALCULATE(COUNT('Table'[New Employees]),FILTER(ALL('Table'),'Table'[Index]=_previousIndex))
VAR _differ= _monthCount - _previousToThis
VAR _NumPercent=DIVIDE(_differ,_previousToThis)
RETURN
IF(ISBLANK(_NumPercent),
0,
_NumPercent)

 

Here is my test data:
 

Date

Location

New Employees

Index

Monday, January 1, 2024

London

1

1

Monday, January 1, 2024

London

1

1

Monday, January 1, 2024

London

1

1

Monday, January 1, 2024

London

1

1

Thursday, February 1, 2024

London

1

2

Thursday, February 1, 2024

London

1

2

Thursday, February 1, 2024

London

1

2

Friday, March 1, 2024

London

1

3

Friday, March 1, 2024

London

1

3

Friday, March 1, 2024

London

1

3

Friday, March 1, 2024

London

1

3

Friday, March 1, 2024

London

1

3

Friday, March 1, 2024

London

1

3


I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
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

4 REPLIES 4
Anonymous
Not applicable

Hi, drx .thanks for your concern about this issue.

Your answer is excellent!
And I would like to share some additional solutions below.

Hello,@RichOB .I am glad to help you.

I hope my test below helps you.

If the date in your real data is fixed to the beginning of each month (the first of each month)
then you can write a measure based on the change in date.

Proportion of monthly increments = 
VAR _monthCount=CALCULATE(COUNT('Table'[New Employees]),ALLEXCEPT('Table','Table'[Date]))
VAR _date =MAX('Table'[Date])
VAR _previousDate=EOMONTH(_date,-2)+1
VAR _previousToThis=CALCULATE(COUNT('Table'[New Employees]),FILTER(ALL('Table'),'Table'[Date]=_previousDate))
VAR _differ= _monthCount-_previousToThis
VAR _NumPercent=DIVIDE(_differ,_previousToThis)
RETURN
IF(ISBLANK(_NumPercent),
0,
_NumPercent)

 

vjtianmsft_0-1730954405309.png

If your dates are not fixed (fixed to the first day of the month), I recommend that you start by grouping by date.

Sort and group the dates by power query to generate an index column.

1. Group all rows according to the date column.

vjtianmsft_1-1730954472105.png

vjtianmsft_2-1730954478362.png

create index column

vjtianmsft_3-1730954504923.png

3. Expand the table

vjtianmsft_4-1730954541206.png

Calculated based on the change in the index column measure
index-1 is the previous date to the current date

vjtianmsft_5-1730954566061.png

M_index = 
VAR _monthCount=CALCULATE(COUNT('Table'[New Employees]),ALLEXCEPT('Table','Table'[Date]))
VAR _index=MAX('Table'[Index])
VAR _previousIndex=_index -1
VAR _previousToThis=CALCULATE(COUNT('Table'[New Employees]),FILTER(ALL('Table'),'Table'[Index]=_previousIndex))
VAR _differ= _monthCount - _previousToThis
VAR _NumPercent=DIVIDE(_differ,_previousToThis)
RETURN
IF(ISBLANK(_NumPercent),
0,
_NumPercent)

 

Here is my test data:
 

Date

Location

New Employees

Index

Monday, January 1, 2024

London

1

1

Monday, January 1, 2024

London

1

1

Monday, January 1, 2024

London

1

1

Monday, January 1, 2024

London

1

1

Thursday, February 1, 2024

London

1

2

Thursday, February 1, 2024

London

1

2

Thursday, February 1, 2024

London

1

2

Friday, March 1, 2024

London

1

3

Friday, March 1, 2024

London

1

3

Friday, March 1, 2024

London

1

3

Friday, March 1, 2024

London

1

3

Friday, March 1, 2024

London

1

3

Friday, March 1, 2024

London

1

3


I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

drx
Frequent Visitor

wrap the date add in a 
Calculate(
sum(new employees),
Filter(
[table that contains date],
DATEADD([Date],-1,Month)

drx
Frequent Visitor

You could do something like
sum(new employees)
/
Calculate(
sum(new employees),
DATEADD([Date],-1,Month)
-1

if its a kpi in the first half of the sum you would use calculate and filter the date with month([date collumn]) = Month(TODAY())
but if its for the tabel you can leave it like above and remove the date collumn and replace by a month one 

this is my first time answering and im pretty new to BI so i might be wrong

Hi @drx thanks for your reply.

 

Unfortunately it's giving me the error message:

"A function 'DATEADD' has been used in a True/False expression that is used as a table filter expression. This is not allowed."

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.