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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
VizDataLtd
Helper I
Helper I

How do use createSelectionIdBuilder correctly with multiple categories?

Hello,

When I select 'b' in the top row (first item), Sunday is selected in the standard pie charts (first item). When I select 'a' (second item), Saturday is selected in the pie chart (second item). This is despite selectionId correctly logging the table name and field name.

 

VizDataLtd_0-1718180691657.png

 

I have some test categories - Day of week, parentCategory and cutAcrossCategory:

 

Day of weekparentCategorycutAcrossCategoryDateDecimalsIntegersThousands
Mondayaq02/14/20240.00111000
Thursdayaw02/14/20270.0002544000
Saturdayaq02/14/20290.255000
Tuesdaybw02/14/20250.122000
Wednesdaybq02/14/20260.3533000
Fridaybw02/14/20280.0333000
Sundaybq02/14/20300.366000
Mondayaw02/14/20240.00111000
Thursdayay02/14/20270.0002544000
Saturdayay02/14/20290.255000
Tuesdayby02/14/20250.122000
Wednesdayby02/14/20260.3533000
Fridayby02/14/20280.0333000
Sundayby02/14/20300.366000

 

There are 14 rows. ParentCategory neatly maps to Day of Week - so wherever we have ParentCategory = a, Day of Week is Monday, Thursday and Saturday. CutAcrossCategory, as the name suggests, is meant to disrupt this, so one of these categories does not neatly map to Day of Week.

 

I have a visual that uses a single number (measure) series, and n categories, and visualises the result as n bars, each split by their category items. I also have three pie charts, one for each category above, for testing.

 

When I click on a rectangle (one category item), I can see the selectionId is correct - the dataMap and Key show me the table name and field, and the value of that field. However, when I click the first item in parentCategory on my visual, the first item of DayOfWeek is selected in a standard pie chart showing DayOfWeek (this is Sunday). On the parentCategory pie, the Sunday portion of 'b' is selected.

 

 

 

                this.selectionManager.select(selectedId, multiSelect)
                    .then((ids) => {
                        console.log("Selected IDs after click:", ids);//logs correctly
                    });

 

 

 

Here is the logged object:

 

 

[
    {
        "deepestNodeLevelInPath": -1,
        "measures": [],
        "dataMap": {
            "data.parentCategory": [
                {
                    "identityIndex": 0
                }
            ]
        },
        "nodeIsCollapsed": null,
        "nodeIndexes": [],
        "key": "{\"data.parentCategory\":[{\"identityIndex\":0}]}[]"
    }
]

 

 

So the parentCategory[0] is triggering a DayOfWeek[0] selection in standard visuals. Can anyone help me explain why?

1 REPLY 1
v-shex-msft
Community Support
Community Support

HI @VizDataLtd,

According to your description, it sounds like your requirement should more related to custom visual dev. I'd like to suggest you post these at the custom visual development forum to get better support.

Custom Visuals Development Discussion - Microsoft Fabric Community
Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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 FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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