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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors