Forum Discussion
PowerBI123456
Post Partisan
6 years agoMatching by Index
Hi, below is my example. I want to be able to indicate (in a measure) that Drug Unit, Index 2 had an NDC added for the same index 2. I also want to see instances where that is not happening. For exam...
- 6 years ago
Hi PowerBI123456 ,
Please check if this is what you want:
Measure = IF ( MAX ( 'Table'[Field] ) = "Drug Unit", IF ( COUNTX ( FILTER ( ALL ( 'Table' ), [index] = MAX ( [Index] ) && [Field] = "NDC" ), [Data] ) > 0, "Yes", "No" ) )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.
amitchandak
Super User
6 years agoif(countx(filter(Table, [index] =earlier([Index]) && [Field] = "Drug Unit" && earlier([field]) ="NDC"),[Data])>0, "Yes", "No")
or
if(countx(filter(Table, [index] =earlier([Index]) && [Field] = "Drug Unit" && earlier([field]) ="NDC"),earlier([Data]))>0, "Yes", "No")