Forum Discussion

JohnLow's avatar
JohnLow
Helper I
5 years ago
Solved

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. 

 

  • 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.

4 Replies

  • HotChilli's avatar
    HotChilli
    Community Champion

    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.