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.
Hello there!
If I understood correctly,
you're trying to modify a line chart in Power BI so that when you filter by Active projects (Yes/No), the selected projects (Yes) appear as lines and the remaining projects (No) remain as dots.
This is what I think you should try:
Create Two Measures:
- One for Active Projects (to display as a line).
- One for Inactive Projects (to display as dots).
DAX MeasuresMeasure for Active Projects (Yes - Line): ActiveProjectDuration =
IF(
SELECTEDVALUE(Projects[Active]) = "Yes",
SUM(Projects[Duration]),
BLANK()
)
Measure for Inactive Projects (No - Dots): InactiveProjectDuration =
IF(
SELECTEDVALUE(Projects[Active]) = "No",
SUM(Projects[Duration]),
BLANK()
)
Then layer the two charts together!
Hope this helps 🙂