7 Replies Latest reply: Apr 17, 2018 10:25 AM by Mark Little RSS

    Current Month , Current and previous years

    K Kv

      Hello,

       

      My chart look like this Capture.PNG

       

      Measures that I use :

      Sum({$<[Date]={">=$(=AddYears(Date(MonthStart(Today())),0)) <=$(=AddYears(Date(Today()),0))"}>}FactSoldAmount)  --- for 2018

      Sum({$<[Date]={">=$(=AddYears(Date(MonthStart(Today())),-1)) <=$(=AddYears(Date(Today()),-1))"}>}FactSoldAmount) --- for 2017

      Sum({$<[Date]={">=$(=AddYears(Date(MonthStart(Today())),-2)) <=$(=AddYears(Date(Today()),-2))"}>}FactSoldAmount)  ----- for 2016

       

      I want to have current month information as default but when I select the month it should show the selected month's data in these years.

      I wrote this but it doesn't work

       

      If( GetSelectedCount(Month)=0,

      Sum(Sales),

      Sum({$<[Date]={">=$(=AddYears(Date(MonthStart(Today())),0)) <=$(=AddYears(Date(Today()),0))"}>}Sales)

      )   --------- for 2018

       

      But it shows me the whole year's data.