Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
In my line chart I would like to have a solid line for actual values and a dotted line for the target value. How can I manage this with my data set below?
| Value | Comment | Timeline | Order |
| 782 | Initial Value | 1 | |
| 640 | Q4 2023 | 2 | |
| 631 | Q1 2024 | 3 | |
| 600 | Q2 2024 | 4 | |
| 500 | Today | 5 | |
| 415 | Target Count | Target Count | 6 |
Solved! Go to Solution.
Hi @dswallow ,
You can use these DAXs to create two measures:
Real_Count =
CALCULATE(
SUM('Table'[Value]),
'Table'[Comment] = BLANK()
)Target_Count =
VAR _Target = MAXX(ALL('Table'), 'Table'[Order])
RETURN
CALCULATE(
SUM('Table'[Value]),
'Table'[Order] = _Target || 'Table'[Order] = _Target - 1
)
Then create the line chart:
Set the line of measure Target_Count as Dotted:
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @dswallow
Pls follow below steps..
Step-1
Imagine your visual is like this..
Step-2
Go to Lines option in Formatt settings..
Click on drop down option in Line Style
Select Targeted Value..
Then select your line styles as Dashed/dotted as required by you..
Now you will get dotted line for Targetted value
Let me know if it works..
Hi @dswallow - can you please share some more sample data excel copy for reference or share the pbix file by removing the sensitive data.
it helps as per above data , we have only one target count value 6.
please share.
Proud to be a Super User! | |
I cannot upload the excel but here is the data in a table. please note I only have one target value
| Value | Comment | Timeline | Order |
| 800 | Initial Value | 1 | |
| 700 | Q4 2023 | 2 | |
| 500 | Q1 2024 | 3 | |
| 450 | Q2 2024 | 4 | |
| 400 | Today | 5 | |
| 350 | Target Value | Target Count | 6 |
Hi @dswallow ,
You can use these DAXs to create two measures:
Real_Count =
CALCULATE(
SUM('Table'[Value]),
'Table'[Comment] = BLANK()
)Target_Count =
VAR _Target = MAXX(ALL('Table'), 'Table'[Order])
RETURN
CALCULATE(
SUM('Table'[Value]),
'Table'[Order] = _Target || 'Table'[Order] = _Target - 1
)
Then create the line chart:
Set the line of measure Target_Count as Dotted:
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you - I would like the target value to be connected to the last present value which would be 'today'. so up to today would be a solid line and the target value would then be dashed. please see excel attached.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 38 | |
| 36 | |
| 30 | |
| 28 |
| User | Count |
|---|---|
| 128 | |
| 88 | |
| 79 | |
| 67 | |
| 62 |