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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
jean004
Frequent Visitor

Apply Max from one column to all the matching rows of same ID in another column

 

IDTermIs Current TermCurrent TermMax Active Term of ID
11  2
12Yes22
13  2
21  3
22  3
23Yes33
24  3
25  3

 

I have a table something to the above, where I have IDs of contracts.  There is a contract term field term (with additional start/end dates in other columns) and I have a field that tells me what is the active term of the contract.    I created a column to return to me the Current Active term.  However, I do not understand/know how to get the last column which would apply the max term to all of the matching ID rows.  Sort of like a MaxIF statement.

 

2 REPLIES 2
jean004
Frequent Visitor

Thank you.  appreciate this.   Hopefully this isn't a bad question.  I know how to run Measure using PowerPivot, however I can't remember at this point how to accomplish this in PowerQuery.

 

In the meantime, I just completed trying a different way, and this was creating a function of the query up to the point of my table, and then creating a grouping with Max for dates and Term to get the results I wanted and merging them back in the previous query.  It works as I was hoping but it does take a bit of time to process and refresh everything.

 

In your opinion would using the method above work better then what I have done?

Chew_WenJie
Resolver III
Resolver III

Hi, you may try this measure 

Measure = CALCULATE(MAX(Table[Current Term]),ALLEXCEPT(Table,Table[ID]))
 
Hope this can help you.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.