Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello -
I'm working on creating a Gantt Chart and was able to leverage the one from @KerKol (thanks so much!)
I have a list of projects that are further defined into 3 different steps: Fieldwork, Planning, Reporting (Project Category). And I currently have it distinguished by different colors as below.
However - I would like to drill everything up (as below), but wanted to see if there was a way to keep the 3 distinguished colors, instead of the solid color line? I've been playing around with the conditional formatting, but haven't had success.
Link to Kerkol's Power BI file: https://community.fabric.microsoft.com/t5/Data-Stories-Gallery/WoW-2022-Week-08-Gantt-Chart/m-p/2366... (I'm using the "Impossi-Puzzle" / 4 of 4 view)
Solved! Go to Solution.
Hi @skyraptor ,
For this you need to create a specific measure that considers the level at wich you are and use it on your condittional formatting:
Colour Formatting =
VAR temptable =
FILTER (
Projects,
Projects[Start Date] <= MIN ( 'Calendar'[Date] )
&& Projects[End Date] >= MAX ( 'Calendar'[Date] )
)
VAR categoryvalue =
MAXX ( temptable, Projects[Project Category] )
VAR totalrows =
COUNTROWS ( temptable )
RETURN
SWITCH (
TRUE (),
totalrows = 1
&& categoryvalue = "FieldWork", "Red",
totalrows = 1
&& categoryvalue = "Planning", "Blue",
totalrows = 1
&& categoryvalue = "Reporting", "Yellow",
"Green"
)
For this metric to work with the individuals colour within each of the values you need to be sure that there is no overlap of dates for each category, that is why I made the totalrows that checks if there is a single category value for each one, if there is more than one I return the green,
The measure needs to be updated for you specific usecase.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsThis looks like it will work, much appreciated. Thank you!
Hi @skyraptor ,
For this you need to create a specific measure that considers the level at wich you are and use it on your condittional formatting:
Colour Formatting =
VAR temptable =
FILTER (
Projects,
Projects[Start Date] <= MIN ( 'Calendar'[Date] )
&& Projects[End Date] >= MAX ( 'Calendar'[Date] )
)
VAR categoryvalue =
MAXX ( temptable, Projects[Project Category] )
VAR totalrows =
COUNTROWS ( temptable )
RETURN
SWITCH (
TRUE (),
totalrows = 1
&& categoryvalue = "FieldWork", "Red",
totalrows = 1
&& categoryvalue = "Planning", "Blue",
totalrows = 1
&& categoryvalue = "Reporting", "Yellow",
"Green"
)
For this metric to work with the individuals colour within each of the values you need to be sure that there is no overlap of dates for each category, that is why I made the totalrows that checks if there is a single category value for each one, if there is more than one I return the green,
The measure needs to be updated for you specific usecase.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsUser | Count |
---|---|
73 | |
69 | |
36 | |
25 | |
22 |
User | Count |
---|---|
97 | |
92 | |
53 | |
45 | |
40 |