Forum Discussion

Kornholio's avatar
Kornholio
Icon for Helper III rankHelper III
6 years ago
Solved

FYTD for Budget

I have a dataset that has this calucaltion for Budget...

 

Current Budget = SUMX(DISTINCT([USDEF]),CALCULATE(MEDIAN(Budget)))
 
using this data...

 

 

What i want is to show FYTD from 4/1/2019 to today. The perioddt is the period for the month. the location is really not that importantfor what i am trying to acheive. We can use the TR date for the calc too

  • Hi Kornholio ,

    If I don't misunderstand, you can create your columns like so:

     

    Year = YEAR('Table'[TR Date])
    FYTD =
    IF (
        'Table'[TR Date] >= DATE ( 2019, 4, 1 )
            && 'Table'[TR Date] <= TODAY (),
        CALCULATE (
            SUM ( 'Table'[Budget] ),
            FILTER (
                ALLEXCEPT ( 'Table', 'Table'[Year] ),
                'Table'[TR Date] >= DATE ( 2019, 4, 1 )
                    && 'Table'[TR Date] <= TODAY ()
            )
        )
    )

     

     PBIX file attached.

     

    Best Regards,
    Icey

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • Try  Total YTD

     

    https://docs.microsoft.com/en-us/dax/totalytd-function-dax

    Year MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date Filer]),"3/31")
    Last Year MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date Filer],-12,MONTH)),"3/31")

     

    Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
    Thanks.

    My Recent Blog - https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

  • Icey's avatar
    Icey
    Icon for Community Support rankCommunity Support

    Hi Kornholio ,

    If I don't misunderstand, you can create your columns like so:

     

    Year = YEAR('Table'[TR Date])
    FYTD =
    IF (
        'Table'[TR Date] >= DATE ( 2019, 4, 1 )
            && 'Table'[TR Date] <= TODAY (),
        CALCULATE (
            SUM ( 'Table'[Budget] ),
            FILTER (
                ALLEXCEPT ( 'Table', 'Table'[Year] ),
                'Table'[TR Date] >= DATE ( 2019, 4, 1 )
                    && 'Table'[TR Date] <= TODAY ()
            )
        )
    )

     

     PBIX file attached.

     

    Best Regards,
    Icey

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.