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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Master_T
Helper I
Helper I

Numeric property in custom visual doesn't work

Hello guys and gals

 

I'm developing a custom visual and I want to have an integer input box for a particular property that can be edited.

So I put this in my capabilities.json:

"objects": {
	"visualSettings":{
		"displayName": "Visual settings",
		"descriptionKey": "visualSettings",
		"properties": {
			"maxFractionDigits":{
				"displayName": "Max fraction digits",
				"displayNameKey": "maxFractionDigits",
				"type": {
					"integer": true
				}
			}
		}
	}
}

 

In my settings objects I have the property defined like this:

public maxFractionDigits: number = 5;

 

However, when the visual properties panel renders the input box does not show up, only the title does, as you can see here:

Master_T_0-1641286896090.png

 

As you can see, I also have a bool and a string property and they render correctly as a toggle switch and a text box. It's just the integer property that doesn't render the editor.

 

What am I doing wrong here?

1 ACCEPTED SOLUTION

@Master_T Hmm, well if numeric works and integer does not, could be a bug? Does seem like a valid value according to this: powerbi-visuals-api/schema.capabilities.json at master · microsoft/powerbi-visuals-api (github.com)

 

You could check the Issues forum here:

https://community.powerbi.com/t5/Issues/idb-p/Issues

And if it is not there, then you could post it.

If you have Pro account you could try to open a support ticket. If you have a Pro account it is free. Go to https://support.powerbi.com. Scroll down and click "CREATE SUPPORT TICKET".


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

@Master_T I think it is supposed to be "numeric" not "integer"


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hello @Greg_Deckler , thanks for your reply.

Using "numeric" works, but it allows the user to input a decimal number, while I would like to only allow integers... is there any way to do that? And why is "integer" one of the allowed values if it is not supported?

@Master_T Hmm, well if numeric works and integer does not, could be a bug? Does seem like a valid value according to this: powerbi-visuals-api/schema.capabilities.json at master · microsoft/powerbi-visuals-api (github.com)

 

You could check the Issues forum here:

https://community.powerbi.com/t5/Issues/idb-p/Issues

And if it is not there, then you could post it.

If you have Pro account you could try to open a support ticket. If you have a Pro account it is free. Go to https://support.powerbi.com. Scroll down and click "CREATE SUPPORT TICKET".


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thank you, I will open a support ticket then.

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.