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
dw700d
Post Patron
Post Patron

Slice 4 items, while only showing 3 on the slicer

I am creating a Gannt chart and I would like to use two slicers that filter the chart based on project and tracker.

 

 

Capture.PNG

I would like to see project A,B &C on the 1st slicer and then see 31 month tracker and 55 month tracker on the 2nd slicer. Here is my data set below

 

Project             Date               End Date                 Forecasting Pace                   Tracker        
A12/30/20197/31/20226/1/202631 Month Tracker
B6/29/20201/31/20238/1/202731 Month Tracker
C12/31/20207/31/202310/1/202731 Month Tracker
A12/30/20197/31/20246/1/202655 Month Tracker
B6/29/20201/31/20258/1/202755 Month Tracker
C12/31/20207/31/202510/1/202755 Month Tracker
D12/30/20196/1/202612/31/2026Forecast
D12/30/20198/1/202712/31/2026Forecast
D12/30/201910/1/202712/31/2026Forecast

 

 

When I select a project in the project slicer I would like project D to accompany that item in the gantt visual. So for example when I select Project A I should see Project A and Project D in the Gantt visual. When I select Project B I should see Project B and Project D in the visual and When I select Project C I should see Project C and Project D in the visual. I do not want to see Project D listed on my slicer, only projects A,B& C. Anyone have any suggestions on how I can accomplish this?

1 ACCEPTED SOLUTION

Hi @dw700d ,

 

Please try this:

 

Create a new table and use its column as slicer.

Project =
CALCULATETABLE (
    VALUES ( 'Table'[Project] ),
    FILTER ( 'Table', NOT ( 'Table'[Project] IN { "D" } ) )
)
Measure = 
IF (
    SELECTEDVALUE ( 'Table'[Project]) IN ALLSELECTED ( 'Project'[Project] )
        || SELECTEDVALUE ( 'Table'[Project] ) ="D",
    1,
    0
)

v-xuding-msft_0-1597905462538.png

The measure means if Project(A,B,C,D from table) is in the selected values list (A,B,C from slicer) or Project(A,B,C,D from table) is equal "D", then show 1, else 0.  You could change 1,0 in the formula to what you want display.

 

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@dw700d , To remove the project from slicer is you use visual level filter and remove it.

 

To add the project in formaula

measure =

var _max  = selectedvalue(Table[project])

return

calculate(countrows(Table), Filter(all(Table[project]), Table[project] = _max || Table[project] = "D"))

 

Better to create a separate table for project

@amitchandakThank you for your help. Can you give me a little more detail.  I have created the measure but I dont know what to do next. Should I put it in the filter or the gantt visual? what should I be doing with the project table?

@amitchandakthank you for taking the time to help, I understand how to use the Gannt chart but I dont understand the logic behind creating your measure and how it helps me with my problem. It also appears that the measure cant be placed in the gantt chart

Hi @dw700d ,

 

Please try this:

 

Create a new table and use its column as slicer.

Project =
CALCULATETABLE (
    VALUES ( 'Table'[Project] ),
    FILTER ( 'Table', NOT ( 'Table'[Project] IN { "D" } ) )
)
Measure = 
IF (
    SELECTEDVALUE ( 'Table'[Project]) IN ALLSELECTED ( 'Project'[Project] )
        || SELECTEDVALUE ( 'Table'[Project] ) ="D",
    1,
    0
)

v-xuding-msft_0-1597905462538.png

The measure means if Project(A,B,C,D from table) is in the selected values list (A,B,C from slicer) or Project(A,B,C,D from table) is equal "D", then show 1, else 0.  You could change 1,0 in the formula to what you want display.

 

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.