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

Getting filtered grouping values in custom visual

Hi,

 

I'm writing a custom visual and want to allow the following scenario:

 

1) User picks several grouping columns for the visual

2) These are auto-filtered by other visuals/report filters etc

3) My custom visual gets the distinct values of each grouping column and uses them

 

My inital plan was to have several dataRoles

"dataRoles": [
        {
            "displayName": "Group1",
            "name": "group1",
            "kind": 0
        },
	{
            "displayName": "Group2",
            "name": "group2",
            "kind": 0
        }
        , etc
    ]

 and then have several dataViewMappings

"dataViewMappings": [
	{
		"conditions": [
		    { "group1": { "min": 1, "max": 1 } }
		],
	        "table": {
	            "rows": {
	                "for": {
	                    "in": "group1"
	                }
	            }
	        }
       }
//repeat for other groupings
]

but sadly Power BI will only return one dataView in the visual.update() so it seems for now this will not work

    https://github.com/Microsoft/PowerBI-visuals/blob/master/Capabilities/DataViewMappings.md

 

Is there an alternate way to get the lists I'm after?

 

I considered crossjoining all the columns, but it there are many then the data set size will soon become massive. (especially when the report is first opened and no filters have been applied)

 

Thanks

1 REPLY 1
v-chuncz-msft
Community Support
Community Support

@teroman, You may check if it can be done using a Slicer visualization.
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.