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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
PeteSil
Frequent Visitor

Calculating an Earlier Sum Based off Multiple Criteria

Hello,

 

I am currently trying to pull last month's total for a certain line item that has the following criteria:

-Project

-Cost Code

-Amount

Example of the columns would be:

Month Project Cost Code Amount
9/1/20223704250$10,700
9/1/20223704280$7,800
10/1/20223704250$11,200

 

What I would need the measure to do, is figure out the what the sum is of the earlier amount by Project & Cost Code, referencing the Month column. Mind you there are multiple Projects & an abundance of Cost Codes. So simply having it Filter just for Project 3704 & Cost Code 250 wont work. It needs to be able to find the earlier amount for each item, if there isn't an earlier amount then output 0.

 

Will truly appreciate any help on this, been stuck for quite some time.

1 REPLY 1
lbendlin
Super User
Super User

"Earlier" has a different meaning in Power BI. 

 

Please provide sanitized sample data that fully covers your issue.
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

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

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.