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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
JanRak
Helper I
Helper I

Capabilities.json - two grouping dataRoles, but each to handle different sizes of arrays.

Hi

I'm not sure if I'm doing something wrong, or is it an API limitation.

I've created two fields for the custom visual.
Let's say one field will be populated by a column consisting of 400 elements.
The other field will be populated by a column from a different table consisting of e.g. 50 elements.
When I apply the following and log the dataview, both arrays consist of 50 elements (meaning one got truncated to the size of the smaller array).
Is there a nice way to get both full arrays into my visual?

Here's my capabilities.json file:

 

 

 

{
    "dataRoles": [
        {
            "displayName": "Column 400",
            "name": "column400",
            "kind": "Grouping"
        },
        {
            "displayName": "Column 50",
            "name": "column50",
            "kind": "Grouping"
        }

    ],
    
    "dataViewMappings": [
        {
            "categorical": {

                "categories": {
                    "select": [
                        
                        { "bind": { "to": "column400" } },
                        { "bind": { "to": "column50" } }
                    ]
                }
            },
            "conditions": [
                {
                    "column400": {
                        "max": 1
                    },
                    "column50": {
                        "max": 1
                    }
                }
            ]
        }
    ]
}

 

 

 


Cheers
Jan

1 ACCEPTED SOLUTION
JanRak
Helper I
Helper I

It seems that it is indeed a limitation of the API! 💀

The following seems to confirm this, and offers a workaround.

https://stackoverflow.com/questions/63828778/multiple-unrelated-dataviewmappings-for-custom-visuals-...


View solution in original post

5 REPLIES 5
JanRak
Helper I
Helper I

It seems that it is indeed a limitation of the API! 💀

The following seems to confirm this, and offers a workaround.

https://stackoverflow.com/questions/63828778/multiple-unrelated-dataviewmappings-for-custom-visuals-...


JanRak
Helper I
Helper I

Anyone had a similar problem?

JanRak
Helper I
Helper I

Hi Daniel @dm-p 

Any chance you could take a look into this one (capabilities.json Data Roles), please? 🙏

Cheers
Jan

Anonymous
Not applicable

Hi @JanRak,

Perhaps you can try to use the following code if it works:

{
    "dataRoles": [
        {
            "name": "Group1",
            "kind": "Grouping",
            "displayName": "Group 1",
            "description": "role group with 400 elements"
        },
        {
            "name": "Group2",
            "kind": "Grouping",
            "displayName": "Group 2",
            "description": "role group with 50 elements"
        }
    ],
    "dataViewMappings": [
        {
            "conditions": [
                {
                    "Group1": { "min": 1, "max": 400 },
                    "Group2": { "min": 1, "max": 50 }
                }
            ]
        }
    ]
}

Regards,

Xiaoxin Sheng

Thanks @Anonymous 
I'm afraid this isn't the solution.
Conditions min/max allow to specify the number of data fields that can be placed in a particular data role. So if I set Group1 condition as max 400 that means I can drag 400 columns into that field

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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 community update carousel

Fabric Community Update - June 2025

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