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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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