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
FoXTiSiTY
New Member

Multiple Data Views

Hi,

 

I'm creating a custom Power BI Visual, and I would like to make use of the multiple data views as I don't want to duplicate data coming in and it would be much simpler. But I'm unable to get multiple data views as I always get 1 from the VisualUpdateOptions. 

 

Here is my dataViewMappings config, I'd like to use a table for my dimensions and measures, and then a single for a single value coming in. But this is not working as expected.

 

"dataRoles": [
        {
            "displayName": "Dimensions",
            "name": "category",
            "kind": "Grouping"
        },
        {
            "displayName": "Measures",
            "name": "measure",
            "kind": "Measure"
        },
        {
            "displayName": "Server User ID",
            "displayNameKey": "@LICENSEDUSER",
            "name": "username",
            "kind": "Measure"
        }
    ],
"dataViewMappings": [
        {
            "conditions": [
                {
                    "category": {

                        "max": 20
                    },
                    "measure": {

                        "max": 20
                    }
                }
            ],
            "table": {
                "rows": {
                    "select": [
                        {
                            "for": {
                                "in": "category"
                            }
                        },
                        {
                            "for": {
                                "in": "measure"
                            }
                        }
                    ],
                    "dataReductionAlgorithm": {
                        "top": {
                            "count": 50000
                        }
                    }
                }
            }
        },
        {
            "conditions": [
                {
                    "username": {
                        "max": 1
                    }
                }
            ],
            "single": {
                "role": "username"
            }
        }
    ]

 

 

I did check the documentation and it mentions that multiple data views is possible:

https://learn.microsoft.com/en-us/power-bi/developer/visuals/capabilities#dataviewmappings-how-you-w...

FoXTiSiTY_0-1716561058335.png

 

Can anyone help or explain why this is not working for me?

3 REPLIES 3
Anonymous
Not applicable

HI @FoXTiSiTY,

You can take a look at following links if they suitable for your requirement:

Understand data view mapping in Power BI visuals - Power BI | Microsoft Learn

Objects and properties of Power BI visuals - Power BI | Microsoft Learn

Regards,

Xiaoxin Sheng

Hi @Anonymous,

 

I've gone through all the documentation. As explained in my original post, the documentation states that this is possible, i've also given an example of my capabilities file, but it just doesn't want to work. 

Anonymous
Not applicable

Hi @FoXTiSiTY ,

Were you able to find a solution for the multiple dataViewMappings? I also need that functionality for my custom visual: I'm trying to make a custom visual that has both Cards and a Line Area Chart. Although the documentation noted that combining the single dataViewMapping with anything else was not possible, my visual still doesn't work, and I've tried different permutations: two separate categorical mappings for the cards, table and categorical, matrix and table, and even single and categorical out of desperation. However, nothing works.

Alternatively, do you know if there's a way to store the original unaltered, unfiltered source data as a dataView? 

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.