Forum Discussion
Anonymous
4 years agoNot applicable
Get column values based on condition in another column
Hello, I'm trying to get values in a column that meet a condition in another column. For example, say I have two columns in a table, and I want to get all the values in column2 for which column1 ...
- 4 years ago
Anonymous you can use following two measures
_earliestBeginDate = CALCULATE ( MIN ( Table2[Begin_Date] ), TREATAS ( SUMMARIZE ( Table1, Table1[Values] ), Table2[Values] ) ) _latestEndDate = CALCULATE ( MAX ( Table2[End_Date] ), TREATAS ( SUMMARIZE ( Table1, Table1[Values] ), Table2[Values] ) )
Anonymous
4 years agoNot applicable
Hi Alvin_Zang
Yes, so essentially the function first queries Table1 to get the list of values that meet the filter selection criteria, and then queries Table2 to get the earliest start date and latest end date for the list of those values (the end result is one start date and one end date).
Alvin_Zang
4 years agoFrequent Visitor
Clear. I got another simple solution.
- make a many to many relation like the snapshot below
- write a measure
Earliest Begin Date = MIN( 'Table2'[Begin_Date] )Lastest End Date = MAX( 'Table2'[End_Date] )- Anonymous4 years agoNot applicable
Thanks! I will have to test this again, but it's not giving the exact output that I'm looking for.