Forum Discussion
return table from switch
- Anonymous2 years ago
Hi vfx661 ,
Maybe I misunderstood. But I think you are complicating the issue. You are using TOPN to get the max or min value and then you need to get that row of data, why don't you just use MAXX or MINX?You can check the following results to get Value or ID:
Measure = var _s = SELECTEDVALUE('Table'[Table]) RETURN SWITCH(_s,"A",MAXX('Table A',[Value]),"B",MAXX('Table B',[Value]))An attachment for your reference. Hope it helps!
Best regards,
Community Support Team_ Scott ChangIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hi vfx661 ,
Maybe I misunderstood. But I think you are complicating the issue. You are using TOPN to get the max or min value and then you need to get that row of data, why don't you just use MAXX or MINX?You can check the following results to get Value or ID:
Measure = var _s = SELECTEDVALUE('Table'[Table])
RETURN SWITCH(_s,"A",MAXX('Table A',[Value]),"B",MAXX('Table B',[Value]))
An attachment for your reference. Hope it helps!
Best regards,
Community Support Team_ Scott Chang
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.