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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. 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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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