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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Anonymous
Not applicable

Support other visuals' selection in custom slicer

Hi, I have the following task.

Table DATA has columns: Date, Type, Company, Object, Device, Actual. Table DATES has only one column Date (the table is DISTINCT(DATA[Date]) in DAX). I need to draw chart for some days (two on the picture) before selected date. So I put default slicer visual (top center) to select DATES[Date] and create measure (center) to get max value. After that I try to make custom slicer visual (right) to select required days for chart visual (bottom right) from DATA[Date] using defined measure.

testerPicture.PNG

Used code:

// ISelectionManager creation in visual constructor
this.selectionManager = options.host.createSelectionManager();

// ISelectionManager usage in visual update
const selection: ISelectionId[] = [];
// ... filling selection ...
this.selectionManager.select(selection);

Question A. Is there any simplier approach?

When I try to select specific item in default matrix visual (left) that last selection is cancelled.

Question B. How can I support selection made in other visuals (default or custom) in my custom slicer visual?

I saw Sample Slicer project but there is too much code with insufficient description.

Question C. Does "Sample Slicer" contain information that I need? Where should I watch?

 

1 ACCEPTED SOLUTION
v-evelk
Employee
Employee

Hi,

 

To merge filtration, you should use applyJsonFilter with "merge" option.

 

Kind Regards,

 

Evgenii Elkin,
Software Engineer
Microsoft Power BI Custom Visuals
pbicvsupport@microsoft.com

View solution in original post

13 REPLIES 13

Helpful resources

Announcements
March Fabric Community Update

Fabric Community Update - March 2024

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

Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.