Forum Discussion
Line chart customisation
- Anonymous1 year ago
Hi Fali324
Certainly, please check the following changes:
Change the x-asix Table:
X-axis = UNION ( VALUES ( 'Table'[Project] ), SELECTCOLUMNS ( VALUES ( 'Table'[Project] ), "Project", "Select-" & 'Table'[Project] ) )And so do the Measure:
MEASURE = VAR _Slicer = VALUES ( Slicer[Project] ) VAR _length = MAXX ( ADDCOLUMNS ( 'X-axis', "Length", LEN ( 'X-axis'[Project] ) ), [Length] ) - 7 VAR _CurrentPro = SELECTEDVALUE ( 'X-axis'[Project] ) RETURN IF ( _CurrentPro IN VALUES ( 'Table'[Project] ), CALCULATE ( SUM ( 'Table'[Duraction] ), 'Table'[Project] = _CurrentPro ), IF ( ISFILTERED ( Slicer[Project] ), CALCULATE ( SUM ( 'Table'[Duraction] ), 'Table'[Project] IN _Slicer && 'Table'[Project] = MID ( SELECTEDVALUE ( 'X-axis'[Project] ), 8, _length ) ) ) )Then select all the selections of the Slicer and Open all the lines of the selections with "Select-":
You can alse change the Color:
The result is as follow:
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
that doesn't quite work becuase the legend colours will be different becuase each graph has a different selection of graphs due to the mesure.
I can modify the graph manuals by switching the lines on by selecting the series but I just wanted this to be done via a slicer rather than manual
- Anonymous1 year agoNot applicable
Hi Fali324
Unfortunately that power bi doesn't support this feature currently.
Please try this alternative workaround:
Here I create a set of sample:
Then add 2 calculated tables:
Slicer = VALUES ( 'Table'[Project] )X-axis = UNION(VALUES('Table'[Project]),{"Selectedvalue"})
Create a measure:MEASURE = VAR _Slicer = SELECTEDVALUE ( Slicer[Project] ) VAR _CurrentPro = SELECTEDVALUE ( 'X-axis'[Project] ) RETURN IF ( _CurrentPro IN VALUES ( 'Table'[Project] ), CALCULATE ( SUM ( 'Table'[Duraction] ), 'Table'[Project] = _CurrentPro ), CALCULATE ( SUM ( 'Table'[Duraction] ), 'Table'[Project] = _Slicer ) )
Finally add a line chart with the following fields:Close all the lines but Selectedvalue and open all the points except Selectedvalue:
The result is as follow:
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- Fali3241 year ago
Helper II
Can this be altered if multiple projects are selected?
- Anonymous1 year agoNot applicable
Hi Fali324
Certainly, please check the following changes:
Change the x-asix Table:
X-axis = UNION ( VALUES ( 'Table'[Project] ), SELECTCOLUMNS ( VALUES ( 'Table'[Project] ), "Project", "Select-" & 'Table'[Project] ) )And so do the Measure:
MEASURE = VAR _Slicer = VALUES ( Slicer[Project] ) VAR _length = MAXX ( ADDCOLUMNS ( 'X-axis', "Length", LEN ( 'X-axis'[Project] ) ), [Length] ) - 7 VAR _CurrentPro = SELECTEDVALUE ( 'X-axis'[Project] ) RETURN IF ( _CurrentPro IN VALUES ( 'Table'[Project] ), CALCULATE ( SUM ( 'Table'[Duraction] ), 'Table'[Project] = _CurrentPro ), IF ( ISFILTERED ( Slicer[Project] ), CALCULATE ( SUM ( 'Table'[Duraction] ), 'Table'[Project] IN _Slicer && 'Table'[Project] = MID ( SELECTEDVALUE ( 'X-axis'[Project] ), 8, _length ) ) ) )Then select all the selections of the Slicer and Open all the lines of the selections with "Select-":
You can alse change the Color:
The result is as follow:
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.