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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Custom Visualization: capabilities.json & table definition with multiple columns

We have multiple columns defined in our data roles definition and need to be able to define them in our corresponding table.  All of the examples are showing only 1 column within the table:

 

"dataViewMappings": [
    {
        "table": {
            "rows": {
                "for": {
                    "in": "values"
                }
            }
        }
    }
]

We've tried to have multiple 'for' objects, multiple 'in' objects but PBI won't compile the definitions.  Is there a way we can define multiple columns within this table definition?  In v1.9, we got our table for free and now we're attempting to recreate the definition in v2.3 but cannot with our custom visualization.  

 

our data roles:

 

"dataRoles": [
{
"displayNameKey": "Visual_Source",
"name": "Source",
"kind": "GroupingOrMeasure",
"displayName": "Source"
},
{
"displayNameKey": "Visual_Target",
"name": "Target",
"kind": "GroupingOrMeasure",
"displayName": "Target"
},
{
"displayNameKey": "Visual_Weight",
"name": "Weight",
"kind": "GroupingOrMeasure",
"displayName": "Weight"
}, ...

 

@v-viig 

2 REPLIES 2
Anonymous
Not applicable

Hello,

 

Please try the following example.

    "dataRoles": [{
        "name": "Fields",
        "kind": "Grouping",
        "displayName": "Fields"
    }, {
        "name": "Values",
        "kind": "Measure",
        "displayName": "Values"
    }],
    "dataViewMappings": [{
        "table": {
            "rows": {
                "select": [{
                        "for": {
                            "in": "Fields"
                        }
                    },
                    {
                        "for": {
                            "in": "Values"
                        }
                    }
                ]
            }
        }
    }],

 

We will add examples with serveral columns to our documentation.

 

Thanks!

 

Evgenii Elkin,
Software Engineer
Microsoft Power BI Custom Visuals
pbicvsupport@microsoft.com

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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