Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
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
Month | Month Number | Data 1 | Dat2 | Dat3 |
January | 1 | 7,568.10 | 123,326.35 | (15,209.11) |
February | 2 | 13,268.10 | 127,972.25 | 173,897.68 |
March | 3 | 11,696.08 | 203,625.80 | 1,761.34 |
April | 4 | 9,447.04 | 166,556.95 | 2,058.60 |
May | 5 | 9,118.74 | 82,340.65 | (120,270.06) |
June | 6 | 11,579.62 | - | (338,124.90) |
July | 7 | 10,339.48 | - | (301,912.82) |
August | 8 | 9,450.14 | - | (275,944.09) |
September | 9 | 8,397.12 | - | (245,195.90) |
October | 10 | 7,914.24 | - | (231,095.81) |
November | 11 | 10,346.78 | - | (302,125.98) |
December | 12 | 10,147.86 | - | (296,317.51) |
Regards
Solved! Go to Solution.
You can use 2 measures for this. I have taken your sample data and made the below:
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:
If this works, please mark this as the solution.
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
You can use 2 measures for this. I have taken your sample data and made the below:
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:
If this works, please mark this as the solution.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
124 | |
79 | |
49 | |
38 | |
37 |
User | Count |
---|---|
196 | |
80 | |
70 | |
51 | |
42 |