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

Plot line graph without showing last month value

I am plotting sales data from Current Year, Year-1 and Year-2 on a line graph

Year is in the legend, as to have 3 line graphs in one single chart.

 

Problem is that the current month is not yet finished, resulting in a false data point on the current year's graph.

 

I cannot unselect "September" since it will then not show September value for all the years. 

 

How can i not show September of Current year, while still show it for Year-1 and Year-2?

 

pbiquestion.jpg

1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@Ptolemaida , Try using below method

 

Create a DAX Measure to Identify the Current Month:

CurrentMonth = MONTH(TODAY())


Create a DAX Measure for Sales Data Excluding Current Month for Current Year:
SalesExcludingCurrentMonth =
IF(
YEAR([Date]) = YEAR(TODAY()) && MONTH([Date]) = MONTH(TODAY()),
BLANK(),
[Sales]
)


Use the New Measure in Your Line Graph:

Replace the original sales measure with SalesExcludingCurrentMonth in your line graph.
Ensure the Legend and Axis are Correct:

Make sure the Year is in the legend and the Date (or Month) is on the axis.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

1 REPLY 1
bhanu_gautam
Super User
Super User

@Ptolemaida , Try using below method

 

Create a DAX Measure to Identify the Current Month:

CurrentMonth = MONTH(TODAY())


Create a DAX Measure for Sales Data Excluding Current Month for Current Year:
SalesExcludingCurrentMonth =
IF(
YEAR([Date]) = YEAR(TODAY()) && MONTH([Date]) = MONTH(TODAY()),
BLANK(),
[Sales]
)


Use the New Measure in Your Line Graph:

Replace the original sales measure with SalesExcludingCurrentMonth in your line graph.
Ensure the Legend and Axis are Correct:

Make sure the Year is in the legend and the Date (or Month) is on the axis.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






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.