Forum Discussion

RonaldvdH's avatar
RonaldvdH
Post Patron
5 years ago
Solved

Changing my formula

Guys,

 

Is there a way to end the measure so that in the visual it wont display a value further then, in this case, the first blank value in 2021-32

 

The formula has a MAX value in it and that is why i think i need to change the formula

 
Running Total Sales = CALCULATE(
COUNTA( 'Sales'[Salesdate]),
FILTER (
ALL ( 'Date' ),
'Date'[Date] <= MAX('Date'[Date]) )
)

 

 

  • Please try the below and please check whethter there is any performance issue or not.

     

    Running Total Sales =
    IF (
    NOT ISBLANK ( COUNTA ( 'Sales'[Salesdate] ) ),
    CALCULATE (
    COUNTA ( 'Sales'[Salesdate] ),
    FILTER ( ALL ( 'Date' ), 'Date'[Date] <= MAX ( 'Date'[Date] ) )
    )
    )

     

     

3 Replies

  • Please try the below and please check whethter there is any performance issue or not.

     

    Running Total Sales =
    IF (
    NOT ISBLANK ( COUNTA ( 'Sales'[Salesdate] ) ),
    CALCULATE (
    COUNTA ( 'Sales'[Salesdate] ),
    FILTER ( ALL ( 'Date' ), 'Date'[Date] <= MAX ( 'Date'[Date] ) )
    )
    )

     

     

  • Hi, 

     

    Did you try using ISBLANK?

     

    Something like this-

     

    Var a = 

    CALCULATE(
    COUNTA( 'Sales'[Salesdate]),
    FILTER (
    ALL ( 'Date' ),
    'Date'[Date] <= MAX('Date'[Date]) )
    )
     
    Return
    If(ISBLANK(a), blank(),a)
    • RonaldvdH's avatar
      RonaldvdH
      Post Patron

      Im afraid that does nothing for the outcome, the line still continues