Forum Discussion

vincentpit's avatar
vincentpit
Frequent Visitor
8 years ago
Solved

Get the YTD formula to work

Hello,   I'm a beginner at Power BI and i'm trying to get the YTD measure to work, but i can't seem to get it right..   What i did is: I have an invoice tables INVOICES containing invoices sinc...
  • vik0810's avatar
    vik0810
    8 years ago

    I downloaded your file and used this measure, it works.

     

    ColumnYTD =
    VAR Day1 =
        DAY ( NOW () )
    VAR Month1 =
        MONTH ( NOW () )
    VAR Year1 =
        MAX ( DATUM[Year] )
    RETURN
        CALCULATE (
            SUM ( FACTUREN[TOTAAL] ),
            AND (
                DATUM[Date] >= DATE ( Year1, 1, 1 ),
                DATUM[Date] <= DATE ( Year1, Month1, Day1 )
            )
        )