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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.