Forum Discussion

watje255_ju's avatar
watje255_ju
Icon for Helper III rankHelper III
4 years ago
Solved

Fix Line Graph for breaks in data, replace blank with 0, then leave blank for months after last sale

Hello,    I have used an IF funtion to replace the blank gross margin % (for months when there is no sales) for 0, so that my line graph doesnt break.    However I then want the months in which t...
  • tamerj1's avatar
    4 years ago

    Hi watje255_ju 
    I hope this is what your looking for https://www.dropbox.com/t/6CtxqpNbKlUr0hd7

    Stop GM % after last sale = 
    Var LastSalesDate = CALCULATE ( MAX (Margin[Month] ), REMOVEFILTERS ( ) )
    VAR Result = 
        IF ( MAX ( DimDate[DateKey]) <= LastSalesDate, [GM% with 0 replacing blank] ) 
    RETURN
        Result