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

View all the Fabric Data Days sessions on demand. View schedule

Reply
JohnLow
Helper I
Helper I

Using a measure on a line chart.

Hi, 

 

I'm currently having an issue with a measure on a line chart and when I try to run a filter, it just disappears. 

I created a measure as follows: 

Measure15 = CALCULATE(SUM('Table (2)'[Budget total]), SAMEPERIODLASTYEAR('Table (2)'[YearPeriod]))
This shows up in my table fine but when I add to a line chart or try to filter it, it disappears.
 
I've included my data here
 
Thank you for any help. 

 

2 ACCEPTED SOLUTIONS
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

HotChilli
Super User
Super User

SAMEPERIODLASTYEAR works best with a Date table, so create a date table (with a date column and year column), link it your fact table, and replace any field in the visuals with appropriate fields from the date table.

Change the measure to :

Measure15 = CALCULATE(SUM('Table (2)'[Budget total]), SAMEPERIODLASTYEAR(TableDates[Date]))

 

Good luck.

View solution in original post

4 REPLIES 4
HotChilli
Super User
Super User

SAMEPERIODLASTYEAR works best with a Date table, so create a date table (with a date column and year column), link it your fact table, and replace any field in the visuals with appropriate fields from the date table.

Change the measure to :

Measure15 = CALCULATE(SUM('Table (2)'[Budget total]), SAMEPERIODLASTYEAR(TableDates[Date]))

 

Good luck.

Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Brilliant, thank you. 

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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