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
paul-maessen
Resolver I
Resolver I

How to make sure the data-fields are set to the right data-role after an upgrade of your visual

Hi,

 

When creating a new version of a Custom Visual I noticed that the fields from the data-set were set for a different data-role in my updated Custom Visual.

 

In the code below you see the dataRoles and dataViewMapping-part of the capabilities.json file:

 

    "dataRoles": [
        {
            "displayName": "Name",
            "name": "name",
            "kind": "Grouping"
        },
        {
            "displayName": "Date",
            "name": "date",
            "kind": "Grouping"
        },
        {
            "displayName": "Value",
            "name": "value",
            "kind": "Measure",
            "requiredTypes": [
                {
                    "integer": true
                },
                {
                    "numeric": true
                }
            ],
            "preferredTypes": [
                {
                    "numeric": true
                }
            ]
        },
        {
            "displayName": "Target",
            "name": "target",
            "kind": "Measure",
            "requiredTypes": [
                {
                    "integer": true
                },
                {
                    "numeric": true
                }
            ],
            "preferredTypes": [
                {
                    "numeric": true
                }
            ]
        },
        {
            "displayName": "Tooltips",
            "name": "tooltips",
            "kind": "Measure"
        }
    ],
    "dataViewMappings": [
        {"conditions": [
            {
                "name": {
                    "min": 0,
                    "max": 1
                },
                "date": {
                    "min": 0,
                    "max": 1
                },
                "value": {
                    "min": 0,
                    "max": 1
                },
                "target": {
                    "min": 0,
                    "max": 1
                },
                "tooltips": {
                    min: 0
                }
            }
        ],
            "table": {
                "rows": {
                    "select": [
                        {
                            "for": {
                                "in": "name"
                            }
                        },
                        {
                            "for": {
                                "in": "date"
                            }
                        },
                        {
                            "for": {
                                "in": "value"
                            }
                        },
                        {
                            "for": {
                                "in": "target"
                            }
                        },
                        {
                            "for": {
                                "in": "tooltips"
                            }
                        }
                    ], 
                }
            }
        }
    ]

 

 

In the existing version the following columns from the dataset were set for the following data-roles:

ColumnDataRole
ColumnAname
ColumnBdate
ColumnCvalue
ColumnDtarget

 

However when I open the report with the updated visual (without any change to the dataRoles and DataViewMappings) 

ColumnD is attached to the tooltips dataRole....

 

How can I make sure that in this case ColumnD is atached to the target-dataRole instead of the tooltips-datarole?

 

Thanks in advance.

 

Paul

0 REPLIES 0

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.