Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
SivaPhaneendra
Regular Visitor

Custom Visual development

I created a cusotm visual in the developer tools with static data, How I need to change the capabilities for that custom visual so that it accepts data coming from an excel or database source?

2 REPLIES 2
itayrom
Resolver II
Resolver II

When you compile a visual in the DevTools(by clicking the "Compile + Run" button, obviously), the visual's code and metadata are stored in your browser's local storage. When that data is present in the local storage, Power BI Service detects it and adds that visual to your visualizations pane. Therefore, after you compile the visual, when you move back to the Power BI Service tab in the browser, refresh it, go to a report(or create a new report), and click the "Edit Report" button(If not already in edit mode), you'll be able to use it there, which means you'll be able to use whatever Datasets present in your Power BI Service account.

 

Few things to notice:

1. If you re-complie the visual, you'll have to refresh the Power BI Service tab again.

2. If you save the report while your visual is used in it, re-complie the visual and refresh the report page, the visual on the report will be replaced by the newly compiled one.

3. If you access the report from a different browser/computer/(clear the browser's data), the visual won't be displayed(Since it is not present in that environment's local storage).

4. The DevTools have this bug where, despite the fact that you give your visual its own class name, it sometimes stores it(and exports it) under the name "YourVisual", so don't let it confuse you(I know of two ways to manually overcome this issue. If requested, I'll specify them).

 

EDITED:

5. Custom visuals inserted to a report directly from the DevTools are not sandboxed, while exported ones that were added to a report are. Therefore, some API functions may work when inserting a visual the way described above, but not work when that exact same visual is exported and used in a report.

 

EDITED2:

Back to your question-

You don't specify in the capabilities object the data source at all. The data is provided by Power BI itself. What you do specify what kind of data the visual expects to receive and how to map it to the dataview(via the dataRoles and dataViewMappings objects), which is independent of where the data came from(I.e. it's the same for all data sources).

 

Brian_M
Responsive Resident
Responsive Resident

 

I've not done managed this myself, but watched this video yesterday.

 

They begin to talk about connecting it up to your data sources at about 20-21 minute mark.

 

https://channel9.msdn.com/Blogs/Seth-Juarez/Creating-a-Custom-PowerBI-Visualization-from-Scratch-wit...

 

Hope that gets you started..

Helpful resources

Announcements
Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.