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
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

v-shex-msft
Community Support
Community Support

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Thanks @v-shex-msft 
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
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.