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! Learn more

Reply
PbiCeo
Helper II
Helper II

How to get label value of OptionSet Attribute of accountcategorycode for Dynamics entity with PQ

Hello everyone,

 

I tried to get label value of OptionSet Attribute of accountcategorycode for Dynamics entity with PQ,

but I couldn't.

The following is Dynamics web API which works on the browser and I want to do the same thing using PQ.

How should I write it?

GET[OrganizationURI]/api/data/v9.1/EntityDefinitions(LogicalName='account')/Attributes(LogicalName='accountcategorycode')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?
$select=LogicalName&$expand=OptionSet($select=Options),GlobalOptionSet($select=Options)

 


It works as PQ, but it is slightly different from what I want to get and doesn't work for ODBC.
GET[OrganizationURI]/api/data/v9.0/EntityDefinitions(LogicalName='account')?$select=LogicalName&$expand=Attributes($select=LogicalName;$filter=AttributeType eq Microsoft.Dynamics.CRM.AttributeTypeCode'Picklist')

Does anyone give me advice?
Many thanks in advance,
Vladi

2 REPLIES 2
lbendlin
Super User
Super User

show your Web.Contents() Power Query code.

Actually I tried it with Excel using Dynamics connector.

Is Power BI PQ different from Excel PQ? 

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.