Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi,
I want to create custom Power BI visuals for the report. I follow the different links to create custom visuals. But did't get the code for that. I need to know how to write a code in the visuals.ts file. Can you please provide me some basic Idea, How can I write the code? Or Is there any document fot it How to write a code?
I have some inbuilt code but I am getting the following error
Argument of type '{ value: string | number | boolean | Date; identity: string; }' is not assignable to parameter of type 'CategoryViewModel'.
Types of property 'value' are incompatible.
Type 'string | number | boolean | Date' is not assignable to type 'string'.
Type 'number' is not assignable to type 'string'.
Thanks
Hi Krunal,
You can find more information on below github repository.
https://github.com/Microsoft/PowerBI-visuals
Hi @BhaveshPatel,
I see this post, But how can I write a code? Is there any documentation for how to code? I am using the code but it gives me an error.
Argument of type '{ value: string | number | boolean | Date; identity: string; }' is not assignable to parameter of type 'CategoryViewModel'.
Types of property 'value' are incompatible.
Type 'string | number | boolean | Date' is not assignable to type 'string'.
Type 'number' is not assignable to type 'string'
You would find more information on the below VIDEO POST by Sachin Patney.
https://www.youtube.com/watch?v=_thcxwFmH9A
Hi @BhaveshPatel,
I see this video but I am not able understand properly. Is there any documentation available for basic codes?
Sample Bar Chart Repo could be the start point, and you'll need to learn TypeScript first. As for the error message, check Type assertions.
Hi @v-chuncz-msft,
Thanks for your reply. I have follow the Sample Bar Chart Repo and write the same code as explain, but when look in the Power BI I am not able to see the report data.
Thanks
Make sure that all necessary files are added to the files array in tsconfig.json. This allows the TypeScript compiler to load them and in what order. For tips about debugging your custom visual, see the debugging guide.
Hi @v-chuncz-msft,
Thanks for your reply, and I got the solution for this. It was the D3 folder and node_module folder is not able to find the correct file. So it was giving an error.
Hi,
Now I am stuck on color selection for the bar or text. I got the color selection option in theproperty window but I am not able to apply the color to the bars or color. For this I have to add any file which I have forgottotn to add? I am getting error on getSelection() for the color.
Thanks
Krunal Patel
This is another error, better to raise a new thread. That way, community members could easily find the solution to a specific problem. By the way, you may post some screenshots and the related code snippet to better illustrate this issue.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 |