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
Gregory-N
Regular Visitor

DAX Max value if two columns content match

Hi, 

 

I need help to get the MAX from a column if two other columns data is a match.

 

See example and screenshots below;

 

If [ShipmentNo] in my Logistics table is = to [strCntDocID] in my ContainerDT table,  then I want to show the MAX number from the  [IntSeqNo] which is also in my ContainerDT table.

 

GregoryN_0-1661953789185.png

GregoryN_1-1661953865490.png

 

Hopefully someone can assist me.

 

Thanks,

 

Greg

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@Gregory-N 

Add a Calculated Column in your Logistics table as follows:

SeqNoMax =
MAXX (
    FILTER ( ContainerDTtable, ContainerDTtable = LogisticTable[ShipmentNo] ),
    ContainerDTtable[IntSeqNo]
)
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

4 REPLIES 4
Gregory-N
Regular Visitor

Good morning @Fowmy 

 

Thanks for the response.

 

Unfortunately this doesn't work, it brings up an #ERROR.

 

The error message is "The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value"

 

I added the column as per your above measure:

 

SeqNoMax 

= MAXX (
    FILTER ( tblContainersDT, tblContainersDT = 'PD&P Logistics'[ShipmentNo] ),
    tblContainersDT[IntSeqNo]
)
 
Please help with making this work.
 
Regards;
Greg

@Gregory-N 
Hope you added this as a calculated column in your logistic table?
Please share a screenshot of the error

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Hi @Fowmy ,

 

I did add it as a calculated column via fields, see below screenshot as requested.

 

GregoryN_0-1662023463830.png

 

Fowmy
Super User
Super User

@Gregory-N 

Add a Calculated Column in your Logistics table as follows:

SeqNoMax =
MAXX (
    FILTER ( ContainerDTtable, ContainerDTtable = LogisticTable[ShipmentNo] ),
    ContainerDTtable[IntSeqNo]
)
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

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.

Top Solution Authors
Top Kudoed Authors