Forum Discussion

lukynavy's avatar
lukynavy
New Member
9 years ago

Compare non consecutive period data

Hi,

I have this situation:

 

I use the following expression to calculate Anno Corr (max year) and Anno Prec  (min year)

Anno Prec = CALCULATE(sum(Fatturato[€]);FILTER(all(Fatturato[DataComp].[year]);Fatturato[DataComp].[year]= MIN(Fatturato[Anno])))

Anno Corr = CALCULATE(sum(Fatturato[€]);FILTER(Fatturato;Fatturato[DataComp].[year]=MAX(Fatturato[year])))

 

the problem is that if there is some row with blank value since that value wasn't quotated that year, I got the same value of the other year

 

For example 2013 - Genuary - Incoming = 1000 and 2015 - Genuary I don't have any incoming, I got 1000 as well for 2015 even if it should be 0 or blank

 

 

 

1 Reply

  • v-huizhn-msft's avatar
    v-huizhn-msft
    Microsoft Employee

    Hi lukynavy,

    You create a calculated column or measure? You should create a measure, so it will return null when that value wasn't quotated that year.

    If this doesn't solve your issue. Could you please share your .pbix file for further analysis? In your screenshot, I am can't see 2013 and 2015 year. 

    Best Regards,
    Angelia