Forum Discussion
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
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-power-bi-report-server
5 Replies
- AnonymousNot 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
- JanRakHelper I
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
- JanRakHelper I
Anyone had a similar problem?
- JanRakHelper 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-power-bi-report-server