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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.