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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
atrkgl
New Member

PowerBI Custom Visual - Two Grouping Measures

Hello PowerBI Team,

 

I want to create a custom visual that accepts multiple grouping fields with measures. It works successfully, when I use a single grouping field. However, when I add another grouping field, in the debugging console, I saw that there is an entry in metadata, however the array of values are not shown for the second grouping field. Could you help me, how can I reach values of each field in capabilities.json? 

 

In this specific case, I need a set of array values for the target value (I want to disable aggregation/sum operations) that is a GroupingOrMeasure type, xaxis field as a Grouping type, yaxis and forecastingValue as a Measure type. At the end, I want to see all these values in the array for the custom visual.

 

 "dataRoles": [
        {
            "displayName": "X Axis",
            "name": "xaxis",
            "kind": "Grouping",
            "requiredTypes": [
                {
                    "text": true
                }
            ],
            "preferredTypes": [
                {
                    "text": true
                }
            ]
        },
        {
            "displayName": "Y Axis",
            "name": "yaxis",
            "kind": "Measure",
            "requiredTypes": [
                {
                    "numeric": true
                },
                {
                    "integer": true
                }
            ],
            "preferredTypes": [
                {
                    "numeric": true
                },
                {
                    "integer": true
                }
            ]
        },
        {
            "displayName": "Target Value",
            "name": "targetValue",
            "kind": "GroupingOrMeasure",
            "requiredTypes": [
                {
                    "numeric": true
                },
                {
                    "integer": true
                }
            ],
            "preferredTypes": [
                {
                    "numeric": true
                },
                {
                    "integer": true
                }
            ]
        },
        {
            "displayName": "Forecasting Value",
            "name": "forecastingValue",
            "kind": "Measure",
            "requiredTypes": [
                {
                    "numeric": true
                },
                {
                    "integer": true
                }
            ],
            "preferredTypes": [
                {
                    "numeric": true
                },
                {
                    "integer": true
                }
            ]
        }]
 
 "dataViewMappings": [
        {
            "conditions": [
                { "xaxis": { "max": 1 }, "yaxis": { "max": 1 },  "targetValue": { "max": 1 }, "forecastingValue": { "max": 1 }}
            ],
            "categorical": {
                "categories": {
                    "for": { "in": "xaxis" }
                },
                "values": {
                    "select": [
                        { "bind": { "to": "yaxis" } },
                        { "for": { "in": "targetValue" } },
                        { "bind": { "to": "forecastingValue" } }
                    ]
                }
            }
        }
    ]
 
I would be happy, if you can help me on this issue. Thank you very much!
 
Best regards
0 REPLIES 0

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.