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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Segun
Frequent Visitor

Source Code for Hierarchy Slicer

Hi everyone. Please I need the souce code for Hierarchy Sclicer. 

I want to use the slicer for date selection and at the same time use a measured data as the souce data which is dependent on a date group selection. The current slicer only accepts grouped data and text measures but I would like to modify the capabilities so it is able to accept measured data that are dates. This will maek it dynamic.

 

Thanks

1 ACCEPTED SOLUTION
v-viig
Community Champion
Community Champion

Source code can be found here.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

View solution in original post

3 REPLIES 3
jppp
MVP

Hi @Segun,

 

First feel free to look at the code and alter it accordingly.

But may I ask what you what to achieve and can you share an example scenario?

 

Thanks, Jan Pieter

v-viig
Community Champion
Community Champion

Source code can be found here.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

Segun
Frequent Visitor

Thank you Ignatt! @v-viig

 

 

Thank you Jan! @jppp

 

Here is the scenario of what I want to to do. 

 

I have a group of date fields whcih I would like to selected as either Start Date or End Date (see below)start.JPG

 

 

 

 

I have also set up two measured calculations using the funtion "ISFILTERED" to determine which dates are selected about and then go to the column in my data field to give me those date values. I can then use these dates to buld a Ghantt chart showing Start and end dates as selected. 

sd.JPGed.JPG

The next step is now to use the Hierarchy Slicer as a filter (Using my calculated start and end dates as inputs) 

I would like to use two Hierarachy  Slicers to accept the measured calculated dates and change dynamically based on my selection group and mentioned above (see below)

 

filter1.JPGfilter2.JPG

 

Long story short

Step 1 : Use the selection for my start and end dates

Step 2: Use the Hierarachy filted (which looks at my selection) to filter/slice my data so the user can select specific date range.

 

But the problem I am faced with is that Hierarchy filter does not currently accept Measured calculations as an input especially when the input data are dates. 

 

I hope you can help me with this. I am also happy to connect anytime. 

 

Thanks,

Segun. 

 

PS: Please let me know if anyone is planning to attend Microsoft Business Applications Summit in Seattle 22-24th of July. I will be there and I am happy to connect. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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