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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join 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
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.