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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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

Top Solution Authors
Top Kudoed Authors