Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi - i have been trying to find a way of discovering if a selected measure passed into a custom visual is of a percentage format or not.
Does anyone know where in the VisualUpdateOptions object that would be? It doesn't seem to come through on the
object.
Solved! Go to Solution.
Hi @jonespossibly,
With percentage, there is no explicit type for it. They are just regarded as numeric, so the only way to be able to determine would be through the format string, either:
For all data view mappings, each array element should have a source property that will contain a format string if it has been set in the data model. If this is not present then it will not have been explicitly set. If a column or measure has been set as a percentage type, then it should indeed show an appropriate format string to that effect.
If there's no format property present, you can only use the source.type property to try and derive the data type, but IIRC percentage is only stored as a numeric here, as there is no explicity type to denote, e.g.:
Note that date columns can potentially contain percentage characters in their format string, e.g.:
There could be other cases to consider, but combining a type.numeric === true along with checking the format string might be okay.
Hopefully gives you some ideas. 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 @jonespossibly,
With percentage, there is no explicit type for it. They are just regarded as numeric, so the only way to be able to determine would be through the format string, either:
For all data view mappings, each array element should have a source property that will contain a format string if it has been set in the data model. If this is not present then it will not have been explicitly set. If a column or measure has been set as a percentage type, then it should indeed show an appropriate format string to that effect.
If there's no format property present, you can only use the source.type property to try and derive the data type, but IIRC percentage is only stored as a numeric here, as there is no explicity type to denote, e.g.:
Note that date columns can potentially contain percentage characters in their format string, e.g.:
There could be other cases to consider, but combining a type.numeric === true along with checking the format string might be okay.
Hopefully gives you some ideas. 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)
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
7 | |
7 | |
3 | |
2 | |
2 |
User | Count |
---|---|
6 | |
5 | |
4 | |
4 | |
4 |