cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Super User
Super User

Re: TOTALYTD until TODAY

@wverheijen

 

Just checking exactly what you want here:

Do you want "today" (for example 20 June 2018) to be translated into each calendar year?

So if today is 20 June 2018, then when filtering on 2016, you will get the result for 1 Jan 2016 to 20 June 2016?

 



Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!




wverheijen Frequent Visitor
Frequent Visitor

Re: TOTALYTD until TODAY

@OwenAuger

 

thanks for your reply!

This is right, but it's not my intention to filter on a specific year. I want to display all available years in a table with values from 1 Jan to 20 June 2016.

Super User
Super User

Re: TOTALYTD until TODAY

@wverheijen

 

Here's one idea - it's designed to translate TODAY () into all visible years in the current filter context, and evaluate the measure in the context of YTD dates within those years.

 

YTD Values =
VAR TodayDate =
    TODAY ()
VAR TodayMonth =
    MONTH ( TodayDate )
VAR TodayDay =
    DAY ( TodayDate )
VAR YearDateFilter =
    GENERATE (
        VALUES ( Dates[year] ),
        VAR TodayInCurrentYear =
            DATE ( Dates[year], TodayMonth, TodayDay )
        RETURN
            CALCULATETABLE (
                DATESYTD ( Dates[dates] ),
                TREATAS ( { TodayInCurrentYear }, Dates[dates] )
            )
    )
RETURN
    CALCULATE ( [Total Value], KEEPFILTERS ( YearDateFilter ) )


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!




wverheijen Frequent Visitor
Frequent Visitor

Re: TOTALYTD until TODAY

@OwenAuger @Anonymous

 

I got the exact answer in my own post, thank you very much for your input aswell!

 

https://community.powerbi.com/t5/Desktop/YTD-of-years-until-today/m-p/443733#M205094

Highlighted
jlinn Frequent Visitor
Frequent Visitor

Re: TOTALYTD until TODAY

@OwenAuger  you're the man! It worked!

 

YTD Pipeline Creation Goal =
CALCULATE (
TOTALYTD ( SUM('Model'[Pipeline Creation Goal]), 'Date'[date] ),
TREATAS ( { TODAY () }, 'Date'[date] )
)