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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.