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
rcardenasbc
Frequent Visitor

Line graph with solid and dotted lines

Hello, I need a lot of help, I want to make a line graph where the x axis are the months of the year and the y axis are 3 values, but I don't know how to make the lines appear dotted starting from the current month, I already do it. I did it with Python but some visual elements are lost when using the Power BI visual, how can I do this? Thank you very much.
Example data

 

MonthMonth NumberData 1Dat2Dat3
January1     7,568.10 123,326.35   (15,209.11)
February2   13,268.10 127,972.25  173,897.68
March3   11,696.08 203,625.80      1,761.34
April4     9,447.04 166,556.95      2,058.60
May5     9,118.74   82,340.65 (120,270.06)
June6   11,579.62               -   (338,124.90)
July7   10,339.48               -   (301,912.82)
August8     9,450.14               -   (275,944.09)
September9     8,397.12               -   (245,195.90)
October10     7,914.24               -   (231,095.81)
November11   10,346.78               -   (302,125.98)
December12   10,147.86               -   (296,317.51)

Regards

1 ACCEPTED SOLUTION
mark_endicott
Super User
Super User

You can use 2 measures for this. I have taken your sample data and made the below:

mark_endicott_0-1717169804895.png

My two measures are as follows, starting with Previous Months:

VAR month_now =
    MONTH ( NOW () )
VAR calc =
    CALCULATE ( SUM ( 'Table'[Data 1] ), KEEPFILTERS ( 'Table'[Month Number] < 5 ) )
RETURN
    calc

The next one does current and future months:

VAR month_now =
    MONTH ( NOW () )
VAR calc =
    CALCULATE (
        SUM ( 'Table'[Data 1] ),
        KEEPFILTERS ( 'Table'[Month Number] >= month_now )
    )
RETURN
    calc

Once you have put the two measures in the Y-Axis of the chart, you can set the Line settings for the Current Month Line differently:

 

mark_endicott_1-1717170006023.png

If this works, please mark this as the solution. 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @rcardenasbc ,

 

Did @mark_endicott  reply solve your problem? If so, please mark it as the correct solution, and point out if the problem persists.

 

Best Regards,
Adamk Kong

mark_endicott
Super User
Super User

You can use 2 measures for this. I have taken your sample data and made the below:

mark_endicott_0-1717169804895.png

My two measures are as follows, starting with Previous Months:

VAR month_now =
    MONTH ( NOW () )
VAR calc =
    CALCULATE ( SUM ( 'Table'[Data 1] ), KEEPFILTERS ( 'Table'[Month Number] < 5 ) )
RETURN
    calc

The next one does current and future months:

VAR month_now =
    MONTH ( NOW () )
VAR calc =
    CALCULATE (
        SUM ( 'Table'[Data 1] ),
        KEEPFILTERS ( 'Table'[Month Number] >= month_now )
    )
RETURN
    calc

Once you have put the two measures in the Y-Axis of the chart, you can set the Line settings for the Current Month Line differently:

 

mark_endicott_1-1717170006023.png

If this works, please mark this as the solution. 

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.

Top Solution Authors