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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jnnilesh29
Helper III
Helper III

Line Chart: Solid lines up to certain dates and then Dotted line

Hello guys,

 

I have a line chart as follows and wondering if I can get solid green line (Achieved progress) up to a certain date (let's say November 30, 2021) and then followed by dotted green line (Forecast progress)?

 

jnnilesh29_1-1638543642130.png

 

Any help is appreciated.

Thanks,

Nilesh

1 ACCEPTED SOLUTION
v-yetao1-msft
Community Support
Community Support

Hi @jnnilesh29 

Please correct me if I wrongly understand your question .

In your sample, use a certain date 2021-11-30 as the separation point , the value of Achieved progress display as a solid green line and the value of Forecast progress display as a dotted green line .You can realize the requirements by creating measures .I create a sample , you can make a reference .

(1)Create two measures to return the value of Achieved progress before the certain date and the value of Forecast progress after the certain date .

achieved progress before = CALCULATE(SUM('Table'[Achieved progress]),FILTER('Table','Table'[Date]<=DATE(2021,11,30)))
forecast progress after = CALCULATE(SUM('Table'[Forecast progress]),FILTER('Table','Table'[Date]>=DATE(2021,11,30)))

Ailsamsft_0-1638929843856.png

(2)Add a Line chart ,and put these two measures in Values and Secondary values ,date in Axis .

Ailsamsft_1-1638929843858.png

(3)In visual format , turn on Customize series in Shapes . Choose the measure [forecast progress after] and set the Line style to Dotted . Change the line color in Data colors

Ailsamsft_2-1638929843859.png

Ailsamsft_4-1638930032636.png

The final result is as shown :

Ailsamsft_3-1638929843860.png

I have attached my pbix file , you can refer to it .

 

Best Regards

Community Support Team _ Ailsa Tao

View solution in original post

3 REPLIES 3
v-yetao1-msft
Community Support
Community Support

Hi @jnnilesh29 

Please correct me if I wrongly understand your question .

In your sample, use a certain date 2021-11-30 as the separation point , the value of Achieved progress display as a solid green line and the value of Forecast progress display as a dotted green line .You can realize the requirements by creating measures .I create a sample , you can make a reference .

(1)Create two measures to return the value of Achieved progress before the certain date and the value of Forecast progress after the certain date .

achieved progress before = CALCULATE(SUM('Table'[Achieved progress]),FILTER('Table','Table'[Date]<=DATE(2021,11,30)))
forecast progress after = CALCULATE(SUM('Table'[Forecast progress]),FILTER('Table','Table'[Date]>=DATE(2021,11,30)))

Ailsamsft_0-1638929843856.png

(2)Add a Line chart ,and put these two measures in Values and Secondary values ,date in Axis .

Ailsamsft_1-1638929843858.png

(3)In visual format , turn on Customize series in Shapes . Choose the measure [forecast progress after] and set the Line style to Dotted . Change the line color in Data colors

Ailsamsft_2-1638929843859.png

Ailsamsft_4-1638930032636.png

The final result is as shown :

Ailsamsft_3-1638929843860.png

I have attached my pbix file , you can refer to it .

 

Best Regards

Community Support Team _ Ailsa Tao

themistoklis
Community Champion
Community Champion

@jnnilesh29 

 

You should create 2 measures per line (one for solid and one for dotted).

 

See link below:

https://community.powerbi.com/t5/Desktop/Line-Chart-Is-it-possible-to-have-half-of-the-chart-as-soli...

 

Hi @themistoklis ,

 

I did create two measure per the link you shared. However, it is giving me some weird results. Please see the below graph and measures: 

jnnilesh29_0-1638544486742.pngjnnilesh29_1-1638544501212.pngjnnilesh29_2-1638544513963.png

 

Please help. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.