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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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