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
Anonymous
Not applicable

Don't plot future months

Hi Experts

 

The following measure gives me data points on a line graph where there is data - if i have no data point i.e. zero or blank - i get a flat line. I want to be able to amend the measure so it only plots up until the current month -1. i.e, we are in March 21 which is zero in my data set, but i have values for Feb 21.

 

CurrentYear =
VAR CurrentYearSales =
CALCULATE ( SUM ( 'Test Data_'[cr03a_reportscrimemade] ), 'Test Data_'[IsCurrentYear] = TRUE () )
RETURN
IF ( CurrentYearSales = BLANK (), 0, CurrentYearSales )
1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi, @Anonymous 

Please try the below.

 

CurrentYear =
VAR CurrentYearSales =
CALCULATE (
SUM ( 'Test Data_'[cr03a_reportscrimemade] ),
'Test Data_'[IsCurrentYear] = TRUE (),
FILTER (
ALLSELECTED ( 'Test Data_' ),
[daterelatedcolumninthistable] <= TODAY ()
)
)
RETURN
IF ( CurrentYearSales = BLANK (), 0, CurrentYearSales )
 
I hope it works.
 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help the other members find it more quickly.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

1 REPLY 1
Jihwan_Kim
Super User
Super User

Hi, @Anonymous 

Please try the below.

 

CurrentYear =
VAR CurrentYearSales =
CALCULATE (
SUM ( 'Test Data_'[cr03a_reportscrimemade] ),
'Test Data_'[IsCurrentYear] = TRUE (),
FILTER (
ALLSELECTED ( 'Test Data_' ),
[daterelatedcolumninthistable] <= TODAY ()
)
)
RETURN
IF ( CurrentYearSales = BLANK (), 0, CurrentYearSales )
 
I hope it works.
 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help the other members find it more quickly.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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
Top Kudoed Authors