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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
MonK
Regular Visitor

DAX: considering combination of two columns

Hi Community,

 

 

I have an issue where I just can't get on, similar issues here in the forum have already been dealt with, but even they did not give the desired result.

 

I have a table with four columns:

ID 1 / ID 2 / value / date

 

I filter for a value and then need the oldest date per each combination of ID 1 and ID 2.

 

I tried this combination via a VAR with Concatenate, but that does not work. Since I work via live connection, I can't create an auxiliary column either, then this wouldn't be a problem.

 

VAR combination =
Concatenate(selectedvalue(ID1,(selectedvalue(ID2))

 

VAR min_date =
Min(selectedvalue(Combination),
calculate(min(date),filter(value = "xxx")))

 

 

Can you help me here please? What are the possibilities to solve this? Using a quickmeasure I can only select one category at a time, the formula generated by PBI with keepfilters() does not accept two arguments here either.

 

thank you in advance

1 ACCEPTED SOLUTION
daXtreme
Solution Sage
Solution Sage

[Date of Oldest Combination] =
var IDCombinationToLookFor =
    SUMMARIZE(
        T,
        T[ID 1],
        T[ID 2]
    )
var Result =
    CALCULATE(
        MIN( T[date] ),
        IDCombinationToLookFor,
        REMOVEFILTERS( T )
    )
return
    Result

View solution in original post

5 REPLIES 5
MonK
Regular Visitor

this one works, thanks a lot!

MonK
Regular Visitor

Thank you. Unfortunately it's not working with the second VAR: only one column argument is accepted from the min-function.

Do you have any idea here? Thank you

Date of Oldest Combination = 
var IDCombinationToLookFor =
    SUMMARIZE(
        T,
        T[ID 1],
        T[ID 2]
    )
var Result =
    CALCULATE(
        MIN( T[date] ),
        IDCombinationToLookFor,
        ALLSELECTED( T ),
        REMOVEFILTERS( T )
    )
return
    Result

Try the one above... This is what I get:

daXtreme_0-1662114405970.png

 

What does it mean "it's not working with the second VAR"? My MIN function does have one column as the argument: T[date]. Where's the problem?

daXtreme
Solution Sage
Solution Sage

[Date of Oldest Combination] =
var IDCombinationToLookFor =
    SUMMARIZE(
        T,
        T[ID 1],
        T[ID 2]
    )
var Result =
    CALCULATE(
        MIN( T[date] ),
        IDCombinationToLookFor,
        REMOVEFILTERS( T )
    )
return
    Result

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.