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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.