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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors