Forum Discussion
Embedded Analytics API, Data Selection from graph
- 1 year ago
Hi joshbrown ,
Thanks for reaching out to Microsoft Fabric Community and sharing the scenario.
From your description, it looks like you're embedding a Power BI report using the powerbi-client-react library and capturing selected values from visuals for further DAX query generation.
In many cases, capturing selected values works fine when the visual is based on model-bound fields and the selection clearly maps to a data identity. However, there are known limitations when interacting with certain visuals like matrices (especially totals or headers), KPIs, or custom visuals. These may not return the expected value in the selection response or may not emit a usable selection context at all. Additionally, as per official documentation, range and relative slicers are not supported for selection capture and won’t emit identity objects in the response. This behavior is expected and is documented here:
How to handle events in a Power BI embedded analytics application | Microsoft Learn
The ability to capture selected data usually depends on how the interaction is handled in the frontend. If you're using the JavaScript SDK event handlers (for example, something like the dataSelected event), the response can vary based on the visual and how the data is bound. Some visuals don’t expose identity or value in a way that can be retrieved through interaction alone.
A possible approach you can try is to use the getData() method on the visual instance after the user interaction. This method allows you to programmatically access the data behind the visual and may help retrieve the value even when it’s not directly returned in the selection event.
Currently, there is no complete public documentation listing which visuals are fully supported for selection capture. In general, standard visuals like bar charts, tables, and pie charts behave as expected, while some visuals like KPIs or matrix headers may not provide the desired selection output.
Some related discussions which you may find similar,
Solved: Power Bi embedded - interaction through dataSelect... - Microsoft Fabric Community
Power BI Embedded dataSelected event not triggered - Microsoft Fabric Community
Suddenly dataSelected event not getting fired for ... - Microsoft Fabric Community
Hope this helps. Please reach out for further assistance.
If this post helps, then please consider to give a kudos and Accept as the solution to help the other members find it more quickly.
Thank you.
Hi joshbrown ,
Thanks for reaching out to Microsoft Fabric Community and sharing the scenario.
From your description, it looks like you're embedding a Power BI report using the powerbi-client-react library and capturing selected values from visuals for further DAX query generation.
In many cases, capturing selected values works fine when the visual is based on model-bound fields and the selection clearly maps to a data identity. However, there are known limitations when interacting with certain visuals like matrices (especially totals or headers), KPIs, or custom visuals. These may not return the expected value in the selection response or may not emit a usable selection context at all. Additionally, as per official documentation, range and relative slicers are not supported for selection capture and won’t emit identity objects in the response. This behavior is expected and is documented here:
How to handle events in a Power BI embedded analytics application | Microsoft Learn
The ability to capture selected data usually depends on how the interaction is handled in the frontend. If you're using the JavaScript SDK event handlers (for example, something like the dataSelected event), the response can vary based on the visual and how the data is bound. Some visuals don’t expose identity or value in a way that can be retrieved through interaction alone.
A possible approach you can try is to use the getData() method on the visual instance after the user interaction. This method allows you to programmatically access the data behind the visual and may help retrieve the value even when it’s not directly returned in the selection event.
Currently, there is no complete public documentation listing which visuals are fully supported for selection capture. In general, standard visuals like bar charts, tables, and pie charts behave as expected, while some visuals like KPIs or matrix headers may not provide the desired selection output.
Some related discussions which you may find similar,
Solved: Power Bi embedded - interaction through dataSelect... - Microsoft Fabric Community
Power BI Embedded dataSelected event not triggered - Microsoft Fabric Community
Suddenly dataSelected event not getting fired for ... - Microsoft Fabric Community
Hope this helps. Please reach out for further assistance.
If this post helps, then please consider to give a kudos and Accept as the solution to help the other members find it more quickly.
Thank you.