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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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