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
Anonymous
Not applicable

Need an working example of custom visual source code

So I have been trying to get this custom visual working following

https://docs.microsoft.com/en-us/power-bi/developer/custom-visual-develop-tutorial

 

However, except that very first example of "Update Count:0", not a single example code works.  Was this tutorail outdated?  Is there any working example of custom visual available at all?

 

Thanks.

1 ACCEPTED SOLUTION
dm-p
Super User
Super User

The tutorial is outdated and the methods to generate everything are a little different in the new tooling. I posted this in another thread yesterday which may help out in terms of understanding changes between versions and finding some valid v3 source code, but there really needs to be a newer tutorial produced to help newcomers avoid these kinds of issues going forward.

If you want to specifically work with the version in the tutorial you posted, there's a step under the Installing Packages heading that states the following to install the tools:

npm i -g powerbi-visuals-tools

Try this instead:

npm i -g powerbi-visuals-tools@2.5

After that, run:

pbiviz --version

This should show 2.5.0.

Then, run this in the root of your project:

pbiviz update 2.5.0

This will allow your code to compile, if everything looks as per the tutorial. If not, then you can repeat the steps from Creating and installing a certificate (if changing toolset version you need to generate a new certificate, otherwise the developer visual won't connect) and then creating a new visual project as normal.

Note that you will still need to contend with migration to the v3 tooling, but if you just want to explore the custom visuals framework and TypeScript platform to see how things work and learn the basics then this should get you moving.

Good luck!

Daniel

Note that 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




View solution in original post

5 REPLIES 5
dm-p
Super User
Super User

The tutorial is outdated and the methods to generate everything are a little different in the new tooling. I posted this in another thread yesterday which may help out in terms of understanding changes between versions and finding some valid v3 source code, but there really needs to be a newer tutorial produced to help newcomers avoid these kinds of issues going forward.

If you want to specifically work with the version in the tutorial you posted, there's a step under the Installing Packages heading that states the following to install the tools:

npm i -g powerbi-visuals-tools

Try this instead:

npm i -g powerbi-visuals-tools@2.5

After that, run:

pbiviz --version

This should show 2.5.0.

Then, run this in the root of your project:

pbiviz update 2.5.0

This will allow your code to compile, if everything looks as per the tutorial. If not, then you can repeat the steps from Creating and installing a certificate (if changing toolset version you need to generate a new certificate, otherwise the developer visual won't connect) and then creating a new visual project as normal.

Note that you will still need to contend with migration to the v3 tooling, but if you just want to explore the custom visuals framework and TypeScript platform to see how things work and learn the basics then this should get you moving.

Good luck!

Daniel

Note that 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




Anonymous
Not applicable

@dm-p 

Thanks for clearing things up.

I wonder for people like me with entry level of TS, should we just go back to pbiviz 2.5 and figure out thing in those outdated tutorials and then migrate to 3.0, would that be a good way to go?

 

Hi @Anonymous,

I think that if you want to make use of the majority of existing materials out there then I would say yes, for now. If you are learning TS then it will be fine, and doing any migration work will add to that knowledge (if a little inconvenient). Not sure if it will help, but I did a similar tutorial a while back for a conference and this may provide some further inroads into TS and the framework. It uses the older version of the tooling but instructions have been updated to specify version and I have tested that everything still works.

Cheers,

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




Anonymous
Not applicable

@dm-p  First of all, thank you for your help.

I went through the PDF you did for the conference (through the link you provided).  I'd hope there are some details for the "tag" on the pdf slides.  I wonder if you have some detailed tutorial in explanations....thanks again.

Hi @Anonymous - glad to help how I can. 

Tags are explained in the 5th slide. You can either check them out locally to see the code at that point in the presentation, or explore the repo in GitHub and view the changes between tags. Easiest way to do this, would be:

  • Click on Code
  • Click on Releases
  • Find the tag that you want to check and click on the commit ref underneath it to have GitHub show you the changes from the last one, e.g.:
    JlkHhtQ

In terms of detail, everything was explained more during the presentation and would take quite a while to write up fully into an article or guide, and I'm very short on free time at the moment! Smiley Happy

I'm hoping that this repo, in conjunction with the latest reference doc that is available will at least help close some of the gaps that I had when starting out.

Good luck,

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




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.