Forum Discussion
Target Line Based on What-If Parameter
- 8 months ago
Hii armchairexpert
You can create a dynamic target line using your What-If parameter by returning a value only for years between 2021 and the selected Target Year. For years before 2021 or after the selected year, the measure will return blank.
Try this measure:
Target Line =
VAR SelectedYear = SELECTEDVALUE(TargetYear[TargetYear])
VAR CurrentYear = MAX('EmissionData'[Year])
RETURN
IF(
NOT ISBLANK(SelectedYear)
&& CurrentYear >= 2021
&& CurrentYear <= SelectedYear,
1,
BLANK()
)
Add this measure to your line chart as a separate series.
Now the line automatically extends from 2021 up to the chosen year (e.g., 2030) and disappears when a past year is selected.
Hi rohit1991
Thanks for your response.
That showed a straight line. Let me try to explain further.
I have a 'Start CO2 Emission' value of 50.99 for January 2021.
Thanks.
- rohit19918 months agoSuper User
Hii armchairexpert
Please check the complete step-by-step example in the link below. It shows how to start the target line from your 2021 CO₂ value and then gradually decrease it to zero based on the selected Target Year:
- armchairexpert8 months agoHelper III
- rohit19918 months agoSuper User