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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.