Forum Discussion
JOSERB
6 years agoFrequent Visitor
INDEX MATCH in PBI / Merged Tables ?
Hello all, I would like to thank you all for your help. I am a rookie in PBI and you are saving my life vey often (I would not have enough money to pay all the beers I should pay XD) . Unfortuna...
Icey
6 years agoCommunity Support
Hi JOSERB ,
I modified camargos88 's expression. Please check:
1. Create relationship between Table 1 and Table 2.
2. Create a column like so:
Column =
VAR _date =
CALCULATE (
MIN ( 'Table 2'[DATE.T2] ),
FILTER (
'Table 2',
'Table 2'[ID.2] = EARLIER ( 'Table 1'[ID.1] )
&& 'Table 2'[DATE.T2] >= EARLIER ( 'Table 1'[DATE.1] )
)
)
VAR result =
CALCULATE (
DISTINCT ( 'Table 2'[VALUE T2] ),
FILTER (
'Table 2',
'Table 2'[ID.2] = EARLIER ( 'Table 1'[ID.1] )
&& 'Table 2'[DATE.T2] = _date
)
)
VAR Count_ =
COUNTROWS ( RELATEDTABLE ( 'Table 2' ) )
RETURN
IF (
Count_ = 1,
result & " (OK)",
IF ( Count_ > 1, result & " (!)", "null (!)" )
)
BTW, .pbix file attached.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.