Forum Discussion
The Line Chart Breaks Midway
- 1 year ago
Hi letItBept_01 ,
You line breaks because the information starts where the other stops meaning that since you do not have any data point for actual in 2025 the line ends in 2024 and does not connect to the other one.
There are a couple of options here:
Create the following measures:
Total Value = CALCULATE(SUM('Table'[Percentage]), REMOVEFILTERS('Table'[Notes])) Actual = CALCULATE(SUM('Table'[Percentage]) , 'Table'[Notes] = "Actual") Forecast = CALCULATE(SUM('Table'[Percentage]), 'Table'[Notes] = "Forecast") Target = CALCULATE(SUM('Table'[Percentage]), 'Table'[Notes]= "Target")Now add the measures to you line chart in the following order:
- Total Value
- Actual
- Forecast
- Target
Then color you total value in a grey color
Second option:
Do not add the total measure and change the forecast and Target to the following code:
Forecast update = VAR _MinimunYear = MINX( FILTER( ALL('Table'), 'Table'[Notes] = "Forecast" ), 'Table'[Year] ) RETURN IF( SELECTEDVALUE('Table'[Year]) = _MinimunYear - 1, CALCULATE( SUM('Table'[Percentage]), 'Table'[Year] = _MinimunYear - 1 ), CALCULATE( SUM('Table'[Percentage]), 'Table'[Notes] = "Forecast" ) ) Target Updated = VAR _MinimunYear = MINX( FILTER( ALL('Table'), 'Table'[Notes] = "Target" ), 'Table'[Year] ) RETURN IF( SELECTEDVALUE('Table'[Year]) = _MinimunYear - 1, CALCULATE( SUM('Table'[Percentage]), 'Table'[Year] = _MinimunYear - 1 ), CALCULATE( SUM('Table'[Percentage]), 'Table'[Notes] = "Target" ) )Now add the measures in the following order:
- Target Updated
- Forecast Updated
- Actual
See PBIX File attach.
Hi letItBept_01 ,
You line breaks because the information starts where the other stops meaning that since you do not have any data point for actual in 2025 the line ends in 2024 and does not connect to the other one.
There are a couple of options here:
Create the following measures:
Total Value = CALCULATE(SUM('Table'[Percentage]), REMOVEFILTERS('Table'[Notes]))
Actual = CALCULATE(SUM('Table'[Percentage]) , 'Table'[Notes] = "Actual")
Forecast = CALCULATE(SUM('Table'[Percentage]), 'Table'[Notes] = "Forecast")
Target = CALCULATE(SUM('Table'[Percentage]), 'Table'[Notes]= "Target")
Now add the measures to you line chart in the following order:
- Total Value
- Actual
- Forecast
- Target
Then color you total value in a grey color
Second option:
Do not add the total measure and change the forecast and Target to the following code:
Forecast update = VAR _MinimunYear = MINX(
FILTER(
ALL('Table'),
'Table'[Notes] = "Forecast"
),
'Table'[Year]
)
RETURN
IF(
SELECTEDVALUE('Table'[Year]) = _MinimunYear - 1,
CALCULATE(
SUM('Table'[Percentage]),
'Table'[Year] = _MinimunYear - 1
),
CALCULATE(
SUM('Table'[Percentage]),
'Table'[Notes] = "Forecast"
)
)
Target Updated = VAR _MinimunYear = MINX(
FILTER(
ALL('Table'),
'Table'[Notes] = "Target"
),
'Table'[Year]
)
RETURN
IF(
SELECTEDVALUE('Table'[Year]) = _MinimunYear - 1,
CALCULATE(
SUM('Table'[Percentage]),
'Table'[Year] = _MinimunYear - 1
),
CALCULATE(
SUM('Table'[Percentage]),
'Table'[Notes] = "Target"
)
)
Now add the measures in the following order:
- Target Updated
- Forecast Updated
- Actual
See PBIX File attach.
- letItBept_011 year agoNew Member
Thank you!
It looks like the verification will take some time, but I'll give it a try.