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.
Hi,
Trying to achieve a custom table visual. My dataset looks like-:
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
but Desktop is giving some unexpected output.
(adding dollar sign with each cell's element)
Note-: here i have formatted hours as "time" from modelling pane.
A helping hand is appreciated.
Solved! Go to Solution.
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
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
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
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?
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
Please clarify these items:
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
Hi @v-viig,
My npm and pbiviz version are-:
Actually the reason behind error was, in .../node_modules/powerbi-visuals-utils/lib/index.d.ts file (U can find this file here)
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-:
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
3 | |
2 | |
1 | |
1 | |
1 |