Forum Discussion
gatapia
10 years agoFrequent Visitor
How to access context information inside a custom visual
I am building a custom visual that needs to know information about the report it is hosted in and its state. For instance I need the following: - Username of the current user running the report - T...
Brian_M
10 years agoContinued Contributor
Will Thompson shows how at about 28 minutes in this presentation from Data Insights
gatapia
10 years agoFrequent Visitor
itayrom it appears that the powerbi.session.userInfo may not work: https://github.com/Microsoft/PowerBI-visuals/issues/412 I'll try this out later today. Thanks for the tip.
Thanks Brian_M for those resources unfortunatelly it appears that custom visuals do not have access to DAX environment so I cannot use the HASONEVALUE solution.
The visual I am writing actually uses this information (user, filters) to save data against an external DB. We then retreive that information when the user has the same filter values. So its not as simple as just a text field (sorry I was just using that as an example).