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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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