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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
WNelson
Frequent Visitor

formula to get the last month total and then divide by 3

I want to find the total number for last month and then divide it by 3.  I need help with a formual for that.

WNelson_0-1700166713152.png

 

1 ACCEPTED SOLUTION
oritam3210
Helper I
Helper I

measure_name =
VAR maxMonth = MAX(YourTableName[Start (UTC) Month]) 
VAR sumLastMonth = CALCULATE(SUM(YourTableName[Total]), YourTableName[Start (UTC) Month] = maxMonth ) 
RETURN DIVIDE(sumLastMonth ,3) 


Here's a breakdown of what this formula does:
1. VAR maxMonth = MAX(YourTableName[Start (UTC) Month])` determines the most recent month in your data.
2. VAR sumLastMonth = CALCULATE(SUM(YourTableName[Total]), YourTableName[Start (UTC) Month] = maxMonth ) calculates the total for the items in the last month.
3. RETURN DIVIDE(sumLastMonth, 3) divides the total sum from the last month by 3 and returns this value.

Make sure to adjust the column names like `Start (UTC) Month` and `Total` to match the columns in your table.

View solution in original post

3 REPLIES 3
WNelson
Frequent Visitor

Thank you @oritam3210 

Anonymous
Not applicable

Hi @WNelson ,

 

Last Month total / 3 = 
VAR _LASTMONTHSTART = EOMONTH(TODAY(),-2)+1
VAR _LASTMONTHTOTAL = CALCULATE(SUM('Table'[Total]),FILTER('Table','Table'[Start (UTC) Month] = _LASTMONTHSTART))
RETURN
DIVIDE(_LASTMONTHTOTAL,3)

Result is as below.

vrzhoumsft_0-1700460501901.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

oritam3210
Helper I
Helper I

measure_name =
VAR maxMonth = MAX(YourTableName[Start (UTC) Month]) 
VAR sumLastMonth = CALCULATE(SUM(YourTableName[Total]), YourTableName[Start (UTC) Month] = maxMonth ) 
RETURN DIVIDE(sumLastMonth ,3) 


Here's a breakdown of what this formula does:
1. VAR maxMonth = MAX(YourTableName[Start (UTC) Month])` determines the most recent month in your data.
2. VAR sumLastMonth = CALCULATE(SUM(YourTableName[Total]), YourTableName[Start (UTC) Month] = maxMonth ) calculates the total for the items in the last month.
3. RETURN DIVIDE(sumLastMonth, 3) divides the total sum from the last month by 3 and returns this value.

Make sure to adjust the column names like `Start (UTC) Month` and `Total` to match the columns in your table.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

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.