Forum Discussion
Jug
3 years agoFrequent Visitor
Composite key with filter
Hello, I was wondering if you could help me with this question. I use directquery and I need to relate two tables with a composite key but using a filter in one of the fields, for example: Th...
- 3 years ago
Hi Jug ,
Please try:
Measure = var _a = CALCULATE(MAX('ADDRESS'[UPDATE_DATE]),FILTER(ALL('ADDRESS'),[ID_CLIENT]=MAX('ADDRESS'[ID_CLIENT]))) return IF(MAX('ADDRESS'[UPDATE_DATE])=_a&&MAX('CLIENT'[CONTRACT_STATUS])="VALID",1,0)then apply it to the visual level filter:
Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-jianboli-msft
3 years agoCommunity Support
Hi Jug ,
Please try:
Measure =
var _a = CALCULATE(MAX('ADDRESS'[UPDATE_DATE]),FILTER(ALL('ADDRESS'),[ID_CLIENT]=MAX('ADDRESS'[ID_CLIENT])))
return IF(MAX('ADDRESS'[UPDATE_DATE])=_a&&MAX('CLIENT'[CONTRACT_STATUS])="VALID",1,0)
then apply it to the visual level filter:
Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.