Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi ,
Im trying to map a data role to a variable in Visual.ts.
I know how to create the data role but for some reason cant get it to map to a variable.
does anyone know of any simple tutorials or youtube videos that go through and explain the steps?
Thanks,
Tom.
I am not sure what you want to capture in the variable, but when you want to know what data is added to a certain dataRole in your visuals you can look into the DataView.
You can find the metadata-property there that contains all data-columns added to your visuals (dataView[0].metadata.columns). Each MetaDataColumn has a roles-proprty that contains a property with the name of the dataRole it has been added to.
You also could use the DataViewUtils provided by Microsoft to get this information out of the DataView.
I hope this will help you further developping your own visuals.
Regards
Paul
thanks for your comment. i will look into this more shortly.
just to add some more context what i would like to do is map the data value to a configuaration variable within the code as part of an API call to get authentication, it will always be a single value. rather than a table or values to display within the visual. hope this helps
The problem with the custom visuals is that you only get one dataView returned. You can specify multiple dataViews but depending on the conditions you have set the API only returns one dataView.
So if you only need one single value then it sould be part of the dataView you are using which can be a single Value but mostly is categorical, table or matrix.
So if you only provide a single Value for authentication you dont have other data for your visual 🙂
In this case it might be logical that your authentication value is part of your dataView and probably repeated in your table or values.
Regards
Paul
Hi @tomdenby ,
Please review the content in the following link, hope it can help you.
Build Your Custom Visuals in Power BI
Best Regards
thanks for your comment i will look into this further over the next week
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
Check out the May 2024 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
4 | |
3 | |
3 | |
2 |