Forum Discussion

H1r0ka's avatar
H1r0ka
Frequent Visitor
7 years ago
Solved

Var Formula error--Datesbetween

Hello,   I'm trying to add 'datesbetween' for the following formular. However I could not get any value. Could you please support how to modify it?   Column 2 = VAR sales_total =      calculate...
  • v-frfei-msft's avatar
    v-frfei-msft
    7 years ago

    Hi H1r0ka,

     

    As we know, measures could not be added to Goup / X-axis in visuals, So here we need to create a calculated column in SalesTable.

     

    measu1 = VAR sales_total =
    calculate([Actual Total],DATESBETWEEN(DateDimensions[Date],nextday(SAMEPERIODLASTYEAR(LASTDATE(DateDimensions[Date]))),LASTDATE(DateDimensions[Date])))
    
    RETURN
        IF(
            AND (sales_total >= 0, sales_total < 50 ),
            "Minor",
             IF(
                 AND ( sales_total > 50, sales_total < 20000 ),
                 "General"
              ) )

     

    For more details, please check the attachment.

     

    Regards,

    Frank