Forum Discussion
Gantt Chart Visualisation - "Parent Field"
Hello,
Does anyone know if it's possible to have the "Parent" field on the Gantt Chart visualisation change dynamically?
E.g. if I had two or more fields that I wanted to use as the parent, is there a way to allow the user to switch between each option, using a slicer or any other method?
Only one field/column can be added to Parent. I've tried creating a few measures that I thought might solve this, however the visual doesn't allow me to add the measures onto the Parent parameter. Not sure if this is because the measure is returning an invalid result, or if the visual doesn't allow measures for this parameter.
Any ideas or work-arounds would be greatly appreciated.
Hi Mezga ,
I have made a smal sample with the following setup:
I also created the following table:
Brands & Countries = UNION( SELECTCOLUMNS('Table', "Department", 'Table'[Department], "ID", 'Table'[ID], "Axis", "Department"), SELECTCOLUMNS('Table', "Supervisor", 'Table'[Supervisor], "ID", 'Table'[ID], "Axis", "Supervisor") )Add a relationship between the IDs and then setup you gantt;
Check PBIX file attach.
8 Replies
- MFelixSuper User
Hi Mezga ,
Using a similar approach to this one you can achieve what you need.
https://towardsdatascience.com/dynamic-axis-in-power-bi-daxis-72ecb22c119f
- MezgaHelper I
Hi MFelix ,
Thanks for your response. I've given that suggestion a good attempt, however still not entirely sure how to apply to my scenario.
The example you provided requires creation of a measure as per below:
Sales Amt TREATAS = IF( HASONEVALUE('Brands & Countries'[Axis]), SWITCH(VALUES('Brands & Countries'[Axis]) ,"Countries", CALCULATE(SUM('Online Sales'[SalesAmount]) ,TREATAS(VALUES('Brands & Countries'[Value]) ,Geography[RegionCountryName])) ,"Brands", CALCULATE(SUM('Online Sales'[SalesAmount]) ,TREATAS(VALUES('Brands & Countries'[Value]) ,'Product'[BrandName])) ) )However in my case, the fields I want to switch between are all text, so the "SUM" part of the measure is irrelevant.
I tried removing that part of the measure, however it always seems to throw an error.
- MFelixSuper User
Hi Mezga ,
In this case instead of the SUM you can use SELECTEDVALUE for example or MAX/MIN.
Can you please share a mockup data or sample of your PBIX file. You can use a onedrive, google drive, we transfer or similar link to upload your files.
If the information is sensitive please share it trough private message.