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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
v-mubish
Helper I
Helper I

Different Behaviour of Custom Visual in Power BI Service and Desktop

Hi,

 

Trying to achieve a custom table visual. My dataset looks like-:

pbi.PNG

 

I am fetching format from options.dataview for columns. The diff. formats i got from datview in PBI service are-:

for "$" -> ""$"#,##0;\("$"#,##0\)"

for "%" -> "0%"

for hour -> "%h:mm tt"

 

so based on format i am prefixing/suffixing the symbol with cell element when I am printing the table. Works fine in PBI Service

pbi2.PNG

 

but Desktop is giving some unexpected output.

pbi3.PNG

(adding dollar sign with each cell's element)

Note-: here i have formatted hours as "time" from modelling pane.

 

A helping hand is appreciated. 

2 ACCEPTED SOLUTIONS
v-viig
Community Champion
Community Champion

You should use getFormatStringByColumn method to get a correct type that has been specified by Power BI Desktop.

 

I'd recommend that you should use valueFormatter to format values.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

View solution in original post

v-viig
Community Champion
Community Champion

Hello @v-mubish,

 

Could you please install @types/d3@3.5.36 (npm i @types/d3@3.5.36 --save) and try to build the visual again?

Please pay attention to the fact that you should execute all of commands in the visual's directory.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

 

 

View solution in original post

8 REPLIES 8
v-viig
Community Champion
Community Champion

Hello @v-mubish,

 

Does Power BI Desktop return correct types? Do you use formatting-utils to format values?

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

Hi @v-viig,

 

I am not using any formatting utility like formatting-utils or any other, and powerBI shows data type "whole number" for each column except date/time column i.e. "Hour".

 

One thing i observed, when we are changing type or format from modelling pane in PBI Desktop, that format is getting reflected in built-in table visual. But these changes when I am doing, are not getting reflected in my Custom visual.

 

How to reslove this?

v-viig
Community Champion
Community Champion

You should use getFormatStringByColumn method to get a correct type that has been specified by Power BI Desktop.

 

I'd recommend that you should use valueFormatter to format values.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

Hi @v-viig,

 

I am trying to install "FormattingUtils" set that u suggested. I followed the steps for formattingUtils installation.

 

after that, Getting this error while trying to run the visual by using "pbiviz start".

pbi4.PNG

 

need help!!

 

Note-: I have followed all the steps mentioned in this link.

v-viig
Community Champion
Community Champion

Please clarify these items:

  • What version of pbiviz do you use (pbiviz --version)?
  • What version of npm do you use (npm --version)?

 

I suppose that your PC has npm 2 or less. This is why some dependencies weren't installed.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

Hi @v-viig,

 

My npm and pbiviz version are-:

Capture.PNG

Actually the reason behind error was, in  .../node_modules/powerbi-visuals-utils/lib/index.d.ts file (U can find this file here)

Capture2.PNG

 

first line is throwing error.

if I am removing this line then NO error is there while starting the custom visual...but custom visual is not displaying anything just a blank iframe in power BI service. with this blank iframe, in console getting this error-:

 

Capture3.PNG

 

v-viig
Community Champion
Community Champion

Hello @v-mubish,

 

Could you please install @types/d3@3.5.36 (npm i @types/d3@3.5.36 --save) and try to build the visual again?

Please pay attention to the fact that you should execute all of commands in the visual's directory.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

 

 

That worked. thanx @v-viig

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

Top Solution Authors