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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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