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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Solution Authors