Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi,
I'm putting together a custom visual, I want to have an object property of type integer, but the no control shows up when I set type to integer, control is visible when type is numeric.
I don't want decimal values for this control, it should be integers. I can parse the float back to integer in my code but it is not a neat solution.
Below my capabilities.json
"defaultZoomLevel": {
"displayName": "Zoom Level",
"description": "Default Zoom level for map, should be between 0 and 28",
"type": {
"integer": true
}
},
Below my settings.ts
export class ProjectionSettings {
public defaultZoomLevel: number = 7;
}
export class VisualSettings extends DataViewObjectsParser {
public projection: ProjectionSettings = new ProjectionSettings();
}
Properties pane draws a blank when integer = true
Shows a text control when numeric = true.
Thanks for your time and support
Riyas
Solved! Go to Solution.
Hi @riyasdeen,
For the properties pane to completely treat as an integer value, you need to add a validValues object matching the property name to the object instance when enumerating it. This should ensure that you get a control that will ensure whole values, or Power BI will coerce it for you so you don't have to manage it via code.
I honestly have no idea how I figured this out as it's not documented anywhere - the easiest way is to show you where I'd normally do this, so here you go.
Good luck!
Daniel
Proud to be a Super User!
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
Hi @riyasdeen,
For the properties pane to completely treat as an integer value, you need to add a validValues object matching the property name to the object instance when enumerating it. This should ensure that you get a control that will ensure whole values, or Power BI will coerce it for you so you don't have to manage it via code.
I honestly have no idea how I figured this out as it's not documented anywhere - the easiest way is to show you where I'd normally do this, so here you go.
Good luck!
Daniel
Proud to be a Super User!
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
Hi @dm-p ,
That did the trick, thanks for your help. Appreciate it.
One of those undocumented goodies.
Thanks
Riyas
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
3 | |
2 | |
2 | |
1 | |
1 |