Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
dswallow
Helper I
Helper I

Dotted line for my target count

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?

 

ValueCommentTimelineOrder
782 Initial Value 1
640 Q4 20232
631 Q1 20243
600 Q2 20244
500 Today5
415Target CountTarget Count6
1 ACCEPTED SOLUTION
Anonymous
Not applicable

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:

vjunyantmsft_0-1727315074128.png

Set the line of measure Target_Count as Dotted:

vjunyantmsft_1-1727315150229.png


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.

View solution in original post

5 REPLIES 5
suparnababu8
Super User
Super User

Hi @dswallow 

Pls follow below steps..

 

Step-1

 Imagine your visual is like this..

suparnababu8_0-1727269038854.png

Step-2

Go to Lines option in Formatt settings..

suparnababu8_1-1727269109685.png

Click on drop down option in Line Style

suparnababu8_2-1727269155604.png

Select Targeted Value..

suparnababu8_3-1727269193493.png

Then select your line styles as Dashed/dotted as required by you..

suparnababu8_4-1727269260994.png

Now you will get dotted line for Targetted value

 

Let me know if it works..







 

rajendraongole1
Super User
Super User

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.





Did I answer your question? Mark my post as a solution!

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

 

ValueCommentTimelineOrder
800 Initial Value 1
700 Q4 20232
500 Q1 20243
450 Q2 20244
400 Today5
350Target ValueTarget Count6
Anonymous
Not applicable

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:

vjunyantmsft_0-1727315074128.png

Set the line of measure Target_Count as Dotted:

vjunyantmsft_1-1727315150229.png


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. 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.