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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
summit20
Helper I
Helper I

Calculate between rows based on another column

I have a bid sheet with raw bid data as shown in the table below. Every project I enter my bid and am always the top bidder in the row (CCI). I am trying to create another column that shows the difference between my bid and every other bid. I plan to filter this data by the project number so the filtered data will only show one row that says CCI as the bidder. The unfiltered version shows multiple rows that have CCI because it shows every project. How can I show the difference between the bids for each project?

Bids1.JPG

 

1 ACCEPTED SOLUTION

@summit20 , try like

Difference = var _1 = Minx(filter(Sheet1,[Project #] =EARLIER([Project #]) && Sheet1[Bidder]="CCI"),[Bid Amount])
return if(ISBLANK(_1),BLANK(),[Bid Amount]-_1)
Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

6 REPLIES 6
amitchandak
Super User
Super User

@summit20 , Can you share sample data and sample output in table format?

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak Here is what the raw data would look like. Notice the difference column would be some sort of calculated column.

Project #BidderBid Amount
1CCI10
1ABC11
1DEF12
2CCI50
2ABC55
2DEF60
2GHI65

 

Here is what I would hope the output would look like.

 

Project #BidderBid AmountDifference
1CCI10-
1ABC111
1DEF122
2CCI50-
2ABC555
2DEF6010
2GHI6515

@summit20 ,

Difference = var _1 = Minx(filter(Sheet1,[Project #] =EARLIER([Project #]) && [Bid Amount] <EARLIER([Bid Amount])),[Bid Amount])
return if(ISBLANK(_1),BLANK(),[Bid Amount]-_1)
Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak . We are so close! That works as long as CCI is the lowest bidder. I changed the Bid in Project 2 to 105 and it based the calculation off the lowest bidder. Is there a way to make all of the formulas based off of CCI's bid instead of the lowest bidder?

 

Project #BidderBidDifference

1

CCI10 
1ABC11

1

1DEF122
2CCI10550
2ABC55 
2DEF605
2GHI6510

@summit20 , try like

Difference = var _1 = Minx(filter(Sheet1,[Project #] =EARLIER([Project #]) && Sheet1[Bidder]="CCI"),[Bid Amount])
return if(ISBLANK(_1),BLANK(),[Bid Amount]-_1)
Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

That worked!!! Thank you so much!!! Any good resource to help understand how you built this and the logic for this formula to help me better learn PowerBI?

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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