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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
lucmax
Helper II
Helper II

Extract types of dataview metadata

Hey, is there a function or a reliable way to get the type (like number, duration, currency, ...) of each metadata column in the dataview? I can see that the underlyingType and primitiveType is changing but I don't know if this is the desired way to get the type.

Bildschirmfoto 2020-01-14 um 21.56.35.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Regards

Lucas

2 REPLIES 2
dm-p
Super User
Super User

Hi @lucmax,

In terms of structure, the type property is a ValueTypeDescriptor, of which only the properties text thru none are included in the interface spec. This means that the underlyingType thru categoryString properties are presumably added by the developer visual (which the API implements). As such their implementation details aren't in the source code and it's going to be hard to figure out what those mean, or rely on them consistently.

You can see that there are some overlaps also, such as numeric and integer.

In my experience, if I have a dependency on the column type, I'll typically switch on them while iterating through and manage my logic that way (e.g. dates vs. numbers for axes) when building my view model.

If you are able, it might be worth providing some details of your particular use case, as we might be able to find a way to achieve what you are ultimately setting out to do.

Regards,

Daniel





Did I answer your question? Mark my post as a solution!

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,

thanks for the answers, I will try to provide more details of what we want to achive.

 

The problem with the ValueTypeDescriptor for me is, that is does not directly provide information about currency data. Also, if I provide a column with a duration type (in the powerbi data model) it does not have type.duration set to true.

 

In the visual the user can apply custom labels for a graph which we transform and display in a user friendly way (duration: 5d 10h 24m, or currency: 524,56€). For this transformation we need to know the type of the datafield in the power bi data model.

We need to group the types into plain text, standard numeric values, duration and currency values. 

 

regards,

Lucas

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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