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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
skokov_konstant
New Member

Data view mapping in Power BI visuals

Good day

I am creating custom visualization on d3js and pbiviz for powerbi

Here is the code in capabilities.js:

 

{
    "dataRoles":[
        {
            "displayName": "HoleDepth",
            "name": "depth",
            "kind": "Grouping"
        },
        {
            "displayName": "Days",
            "name": "days",
            "kind": "Measure"
        },
        {
            "displayName": "Diametrs",
            "name": "diametrs",
            "kind": "Measure"
        },
        {
            "displayName": "Sensor1",
            "name": "sensor_1",
            "kind": "Measure"
        },
        {
            "displayName": "Sensor2",
            "name": "sensor_2",
            "kind": "Measure"
        },
        {
            "displayName": "Sensor3",
            "name": "sensor_3",
            "kind": "Measure"
        },
        {
            "displayName": "Sensor4",
            "name": "sensor_4",
            "kind": "Measure"
        }
    ],
    "dataViewMappings": [
        {
            "categorical": {
                "categories": {
                    "for": { "in": "depth" }
                },
                "values": {
                    "select":[
                        { "bind": { "to": "days" } },
                        { "bind": { "to": "diametrs" } },
                        { "bind": { "to": "sensor_1" } },
                        { "bind": { "to": "sensor_2" } },
                        { "bind": { "to": "sensor_3" } },
                        { "bind": { "to": "sensor_4" } }
                    ]
                }
            }
        }
    ]
}


But in visualization it is inconvenient to use categorical -> values array

Screenshot_1.png

 

Is it possible to categorical -> values was like an object with keys?:
GfCO8.png

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! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.