Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
https://github.com/anjucvijayan/custom-visual/blob/main/visual.ts --visual.ts file
https://github.com/anjucvijayan/custom-visual/blob/main/capabilities.json --- capabilities.json file
when i console.log options then it shows null values in data view . i have table view.
Hi @Anju_c_v,
The linked repo doesn't look like a complete visual project to be able to tell, but from the looks of things, you're using a scriptResult mapping, which implies you're creating an R visual. In this case, the table data view mapping isn't populated, as expected. The dataset is dispatched to your R script by Power BI, and the results come back in dataViews[0].scriptResult (which is populated, as expected). In this case, you can only access the raw data before it is sent to the R runtime in your R script, not the visual's (minimal) TypeScript code (which only can evaluate the returned output).
The dedicated table data view mapping is only available for a TypeScript visual, and if this is what you intend to set up, you should set it up as per the documentation. This will then be available as you expect (but you won't be able to use R). I also wrote an article some years ago with a simple example of the table data view mapping for TypeScript, which may be helpful - this is a few years old, and the SDK has moved on a bit since then, but the principles should still be similar.
Regards,
Daniel
Proud to be a Super User!
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
actually i need to create a histogram customvisual. so i need to add selection to the visual . so when i debug the code data view is not getting. can't we add selection to r powered visual. if so on which file we need to edit. only on visual.ts file
i have refered
https://learn.microsoft.com/en-us/power-bi/developer/visuals/visuals-interactions
https://learn.microsoft.com/en-us/power-bi/developer/visuals/selection-api these two documentations.
do we need to create histogram using visual.ts file
can you please share the steps to add visual interaction to my visual
If you're creating an R visual (which it looks like you're doing based on your capabilities), you do not have access to the table data view, and you cannot add selection. You can only get access to the script output, via the scriptResult object, meaning that you will not see the original dataset sent to the visual. This is only accessible to your R script.
For access to the table data view mapping and the interactivity APIs, you will need to develop the visual using TypeScript rather than R. You will also need to consider that selection IDs need to be reconciled back to the original data view row sent by Power BI (as Power BI generates the selectors and handles the interactivity on a visual's behalf).
You will also need to bear in mind that if you are transforming your source data into aggregated data, for display, your final result set might nto match this and you will very likely get unexpected results (unless you track and group your originally sent rows to the output and create selectors for all rows, so that when you cross filter these can all be sent back to Power BI to resolve).
Proud to be a Super User!
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.