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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
dgohel
Regular Visitor

Issue while creating new custom visual

I am creating new custom visual with below reference link. 

Link : https://blogs.msdn.microsoft.com/tsmatsuz/2016/09/27/power-bi-custom-visuals-programming/

I am getting error while following his steps while updating kind propery in below code snipet.

 

Error : "instance.dataRoles[0].kind is not one of enum values : Grouping, Measure, GroupingOrMeasure."

 

Code Snipper :

 "dataRoles": [
    {
      "displayName": "Summarize Category",
      "name": "myCategory",
      "kind": 0
    },
    {
      "displayName": "Measure Data",
      "name": "myMeasure",
      "kind": 1
    }
  ],

 

Please do me helpful.

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@dgohel,

 

The new API has changed the kind property.

 "dataRoles": [
    {
      "displayName": "Summarize Category",
      "name": "myCategory",
      "kind": "Grouping"
    },
    {
      "displayName": "Measure Data",
      "name": "myMeasure",
      "kind": "Measure"
    }
  ],
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
MawashiKid
Resolver II
Resolver II

Hi,
Though this blog may contain valuable pieces of information to get you started with Power BI Visuals, the datarole definition was written using an earlier v1.1 version which used integer instead of string values. So in order to make the code run 'as is' you'll either have to use earlier api/v1.1.0 and bring modifications to apiVersion in pibiviz.json, package.json... or simply do an integer to string conversion in order to make it work with new versions. Hope this helps
v-chuncz-msft
Community Support
Community Support

@dgohel,

 

The new API has changed the kind property.

 "dataRoles": [
    {
      "displayName": "Summarize Category",
      "name": "myCategory",
      "kind": "Grouping"
    },
    {
      "displayName": "Measure Data",
      "name": "myMeasure",
      "kind": "Measure"
    }
  ],
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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