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.
I am creating a Gannt chart and I would like to use two slicers that filter the chart based on project and tracker.
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 |
A | 12/30/2019 | 7/31/2022 | 6/1/2026 | 31 Month Tracker |
B | 6/29/2020 | 1/31/2023 | 8/1/2027 | 31 Month Tracker |
C | 12/31/2020 | 7/31/2023 | 10/1/2027 | 31 Month Tracker |
A | 12/30/2019 | 7/31/2024 | 6/1/2026 | 55 Month Tracker |
B | 6/29/2020 | 1/31/2025 | 8/1/2027 | 55 Month Tracker |
C | 12/31/2020 | 7/31/2025 | 10/1/2027 | 55 Month Tracker |
D | 12/30/2019 | 6/1/2026 | 12/31/2026 | Forecast |
D | 12/30/2019 | 8/1/2027 | 12/31/2026 | Forecast |
D | 12/30/2019 | 10/1/2027 | 12/31/2026 | Forecast |
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?
Solved! Go to 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
)
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.
@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?
@dw700d , see if these can help
https://blog.pragmaticworks.com/power-bi-custom-visuals-as-timeline
https://www.youtube.com/watch?v=SO4mk1H94OA
https://xviz.com/visuals/gantt-chart/
https://appsource.microsoft.com/en/product/power-bi-visuals/WA104380765?tab=Overview
https://www.mpug.com/articles/how-to-create-an-amazing-gantt-chart-in-power-bi/
@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
)
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
97 | |
96 | |
81 | |
74 | |
66 |
User | Count |
---|---|
129 | |
106 | |
106 | |
86 | |
72 |