Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

Line Chart - Show only line with data until today

 

 

Dear all,

I have a line chart where i am showing the cummulative values for each month for actual period vs same period last year. 
For the current month shown, November in this example (as per this month), I would only show the days of the month as per the day of the report (as per today for example), for the actual period line.

 

 Do you know if this is possible? and if being possible, how can it be done?

This is what i would like 

 

Thanks in advance,

5 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Depends on that calculation. Is that a measure? If so, then you should be able to use an IF statement to either return a value or BLANK().

    • Anonymous's avatar
      Anonymous
      Not applicable

      Greg_Deckler

      Formulaes used are as follow:

       

      Calculate cumulative:

      Cumulative GPSales GC = CALCULATE([GPSalesGC_CY];FILTER(ALLSELECTED('Date'[Date].[Day]);'Date'[Date].[Day]<=MAX('Date'[Date].[Day])))

       

      Where or how should i apply the IF statement?

       

      Thanks and kind regards,

       

       

      • NAOS's avatar
        NAOS
        Advocate III
        Cumulative GPSales GC = 
        
        IF(LASTDATE('Date'[Date].[Day]) >= TODAY(),
        CALCULATE([GPSalesGC_CY];FILTER(ALLSELECTED('Date'[Date].
        [Day]);'Date'[Date].[Day]<=MAX('Date'[Date].[Day]))),
        BLANK()
        )

        Or something like that... 

    • Anonymous's avatar
      Anonymous
      Not applicable

       

      v-chuncz-msft

      I did try your solution but does not affect the view and does not get the wished result.