Forum Discussion
Row Context issues in IF compare
Anonymous , looking at the formula, you should create it as a column. Not measure
- Anonymous6 years agoNot applicable
It has always been a column. I haven't done anything related to measures.
- sturlaws6 years agoResident Rockstar
Hi Anonymous,
From what I understand, you are creating the column [earliest employee comment] in the 'Ticket'-table. The way you have written your dax, you are not providing any context to the 'earliest employee comment'-table, and it tries to return all rows. If an ID is only present once in 'ticket comments relations', you can make use of LOOKUPVALUE(). If there is a relationship you can use RELATED().
But if an ID can have both [is customer comment]=0 and [is customer comment]=1, you would have to do something like:earliest employee comment = IF ( COUNTROWS ( FILTER ( 'ticket comments relations', [is customer comment] = 1 && 'ticket comments relations'[target id] = tickets[id] ) ) >= 1, MINX ( FILTER ( 'ticket comments relations', 'ticket comments relations'[target id] = tickets[id] && 'ticket comments relations'[type] = 2 ), 'ticket comments relations'[comment id] ), -1 )Cheers,
Sturla
If this post helps, then please consider Accepting it as the solution. Kudos are nice too.