calculate time progress with DAX

At my last customer appointment, the customer asked for a measure to represent the time progress of a variable period in relation to today’s date.

As base for the calculation of the measure time progress, i use the date table form my blog post Erstellen einer einfachen Datumstabelle in DAX.

First we use COUNTROWS to determine the number of days for the filtered total period.
Then we count the number of days, for the filtered period, that are before or on today’s date.
Adding 0 ensures that, for a filtered period after today’s date, not BLANK but 0 is returned.
Finally, we relate the number of days to each other.

time progress = 
VAR TotalPeriod =
    COUNTROWS ( 'Date' )
VAR PeriodUntilToday =
    0
        + COUNTROWS ( FILTER ( 'Date'; 'Date'[Date] <= TODAY () ) )
RETURN
    DIVIDE ( PeriodUntilToday; TotalPeriod )

With the measure of time progress you can show that we today on 30.10. already completed 96.77% of the month, 32.61% of the quarter and 83.01% of the year.

time progress by period

Veröffentlicht von

Marcus Wegener

Marcus Wegener

Marcus Wegener ist Anwendungsentwickler für Business Intelligence und erstellt Lösungen, mit denen sich große Datenmengen schnell analysieren lassen. Kunden nutzen seine Lösungen, um die Vergangenheit zu analysieren, die Gegenwart zu steuern und die Zukunft zu planen, um damit mehr Erfolg zu generieren. Dabei ist seine einzigartige Kombination aus Wissen und Auffassungsgabe ein Garant für ihren Erfolg.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

I accept that my given data and my IP address is sent to a server in the USA only for the purpose of spam prevention through the Akismet program.More information on Akismet and GDPR.