Forum Discussion
How To Get X/Y Position Of Visual
Hello!
I'm relatively new to PowerBI, and I was wondering if its possible to get the X/Y Position of a card in DAX (see photo attached). I need to create a function so that if the visual is within a pre drawn box, the box will change colour, kindof similar to a map.
Any help is appreciated! Thank you : )
6 Replies
- AlexisOlsonSuper User
I don't think it is feasible to do exactly what you're suggesting but there might be some sort of workaround. Can you show an example of how you'd expect it to look?
- AnonymousNot applicable
Hi Alexis,
Thanks for getting back to me! The photo attached might help a bit in terms of what I'm hoping to get working.
So in the first box, I want cards A and B to make up the current value (106) because they're within the box dimensions, but when B is pulled out of the box (seen in the second box), the current sum is only card A.
Originally, I was going to create a measure that will take into account the x and y positions of the card relative to the boxes, but I can't seem to find a function that retrieves those positions.
Any suggestions are greatly appreciated! Thanks.
- AlexisOlsonSuper User
Interesting concept but I don't know how it would work since you can only move the visuals around when you're editing the report, not when the end-user views it (and I'm assuming B 31 is in its own card-like visual).
However, you could control the contents of the box using a slicer instead of dragging pieces around.
- AnonymousNot applicable
Yup, so I was thinking a user would edit the report by just dragging the visual around, as each day, A and B will move to a new box or back to an old box. All other content would be computer generated. Do you think it would be possible to execute something like that with PowerBI? Thanks!
- AlexisOlsonSuper User
There might be some custom visual that has a click and drag interface but I don't know of one personally. Otherwise, I think you'll have to adjust how interaction works and use slicers instead.