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
michal089
Frequent Visitor

DataViewMappings with both table and categorical.

Hi!

 

Lately I came across the situation in which I have to define two different data view mappings. Being precise, I have to define both table and categorical mappings.

 

My code is:

 

    "dataViewMappings": [
        {
            "table": {
                "rows": {
                    "for": {
                        "in": "branches"
                    }
                }
            },
            "categorical": {
                "categories": {
                    "for": { "in": "category" }
                },
                "values": {
                    "select": [
                        { "bind": { "to": "value" } }
                    ]
                }
            }
        }
    ]

But that code won't compile :

 error  JSON  capabilities.json :  instance.dataViewMappings[0] is not exactly one from [subschema 0],[subschema 1],[subschema 2],[subschema 3],[subschema 4]

What am I doing wrong ?

 

Edit1:

 

I tried to create two dataViewMappings but for some reason my visual has crashed:

 

    "dataViewMappings": [
        {
            "table": {
                "rows": {   
                    "select": [
                        {
                            "for": {
                                "in": "measure1"
                            }  
                        },
                        {
                            "for": {
                                "in": "measure2"
                            }  
                        }
                    ]
                }
            }
        },
        {
            "categorical": {
                "categories": {
                    "for": {
                        "in": "categories"
                    }
                },
                "values": {
                    "select": [
                        {"bind": {
                            "to": "values"
                        }}
                    ]
                }
            }
        }
    ]

It seems that pbiviz does not support multiple queries. Anyone tried to create more then one dataViewMapping?

 

Any help would be much appreciated. 

Michal

 

 

1 ACCEPTED SOLUTION
Nafferty
Regular Visitor

Multiple dataViewMappings are not supported currently, which is a pain. I've basically been creating larger than necessary data tables in my model and passing those in, and then transforming the data into the format I need in my JavaScript before rendering my visuals.

 

https://github.com/Microsoft/PowerBI-visuals/issues/251

 

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Can i create two dataview objects for a single pbiviz project?

akshaytech9
Regular Visitor

Hi @v-viig,

 

Adding to the question raised by @rahulvartak, could you please let us know whether any single calculated measure value can be passed along with categorical dataview with many-to-one join relationship ?

 

Thanks,

Akshay

Nafferty
Regular Visitor

Multiple dataViewMappings are not supported currently, which is a pain. I've basically been creating larger than necessary data tables in my model and passing those in, and then transforming the data into the format I need in my JavaScript before rendering my visuals.

 

https://github.com/Microsoft/PowerBI-visuals/issues/251

 

v-viig
Community Champion
Community Champion

No plans to support multi-data mapping. Please use one mapping (e.g. table or categorical).

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

Hi Ignat,

 

If I want to pass the value of a single calculated measure along with my categorical dataview, is it possible ?

 

Thanks & Regards,

Rahul

 

 

 

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.