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 September 15. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors
Top Kudoed Authors