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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors
Top Kudoed Authors