cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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

Accepted Solutions
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

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
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?

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

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.

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

 

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

That worked. thanx @v-viig

Helpful resources

Announcements
November Update

Check it Out!

Click here to read more about the November 2020 Updates!

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

secondImage

Power Platform October Community Highlights

Check out the top community contributors across all of the communities

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors