DATESMTD, DATESQTD, DATESYTD, TOTALMTD, TOTALQTD, TOTALYTD - DAX Guide

Sdílet
Vložit
  • čas přidán 30. 07. 2024
  • DATESMTD: Returns a set of dates in the month up to the last date visible in the filter context.
    dax.guide/datesmtd/
    DATESQTD: Returns a set of dates in the quarter up to the last date visible in the filter context.
    dax.guide/datesqtd/
    DATESYTD: Returns a set of dates in the year up to the last date visible in the filter context.
    dax.guide/datesytd/
    TOTALMTD: Evaluates the specified expression over the interval which begins on the first of the month and ends with the last date in the specified date column after applying specified filters.
    dax.guide/totalmtd/
    TOTALQTD: Evaluates the specified expression over the interval which begins on the first day of the quarter and ends with the last date in the specified date column after applying specified filters.
    dax.guide/totalqtd/
    TOTALYTD: Evaluates the specified expression over the interval which begins on the first day of the year and ends with the last date in the specified date column after applying specified filters.
    dax.guide/totalytd/
    This video is part of DAX Guide, the online guide to all the DAX functions, with links to related content and compatibility matrix with all the versions of Power BI, Azure Analysis Services (AAS), SQL Server Analysis Services (SSAS), SQL Server Data Tools (SSDT), and Power Pivot for Excel.

    How to learn DAX: www.sqlbi.com/guides/dax/?aff=yt
    The definitive guide to DAX: www.sqlbi.com/books/the-defin...
    Code, run, and share DAX with DAX.do: dax.do/?aff=yt

    #dax #powerbi #ssas #tabular #analysisservices #powerpivot
  • Věda a technologie

Komentáře • 14

  • @brianligat9493
    @brianligat9493 Před 7 měsíci +1

    2:33 - 2:37 Just those 4 seconds and suddenly so much of CALCULATE suddenly made sense. Thanks!!!

  • @carlosastudillo8450
    @carlosastudillo8450 Před 2 měsíci +1

    Muy buena explicación muchas gracias me ayudó en mi reporte

  • @sambasivarao576
    @sambasivarao576 Před 2 lety +1

    Very well explained.

  • @distrilanalytics
    @distrilanalytics Před 2 lety +1

    Great sir. Hope to learn more about DAX measures and Practical examples.

  • @user-lm5wb8vi1x
    @user-lm5wb8vi1x Před měsícem

    Finished watching

  • @naveen200848
    @naveen200848 Před 2 lety

    Hi. Great. How can we change the ytd start and end date. As default it takes calendar quarters. We need to change it for fiscal calendar like 1st feb as start.

    • @SQLBI
      @SQLBI  Před 2 lety +1

      There is an additional parameter for the last day of the year, check the syntax on dax.guide

  • @williamarthur4801
    @williamarthur4801 Před 2 lety +1

    Ciao,
    I'm curious about the CALCULATETABLE when the whole is already inside CALCULATE,
    I've had a look in ' THE BOOK', and can't find an explanation, if it's very complex please just say so. Richard.

    • @SQLBI
      @SQLBI  Před 2 lety +1

      CALCULATE returns scalar values (a single number or string) whereas CALCULATETABLE computes a table expression (one or more columns, one or more rows).

    • @williamarthur4801
      @williamarthur4801 Před 2 lety

      @@SQLBI So even though DISTINCT itself returns a table , using CALCULATETABLE is 'best practice' .

  • @RichArd-ee2qj
    @RichArd-ee2qj Před rokem

    Hello, I want to create a comparison of current year to date against previous years.
    I've used DATEADD and it works.
    -However, I need one of the previous years to be calendar year 2019.
    -Using minus 3 worked for year 2022. Now that it is year 2023 I will have to update the formula to minus 4.
    How can I filter for year 2019 without having to update my formula annually?
    See formula below:
    Legend:
    Pax = passengers (I'm analyzing commercial aviation data)
    '_Calendar'[Date] = date table
    Pax YTD 2019 =
    IF (
    ISBLANK ( [Pax] ),
    BLANK (),
    TOTALYTD ( [Pax],
    DATEADD ( '_Calendar'[Date],
    -3, YEAR ) )
    )
    Thx in advance for you help.

  • @Wzxxx
    @Wzxxx Před rokem

    Why date[date] is translated into CALCULATETABLE ( DISTINCT ( ) ? I can't find an explanation in the book or on SQLBI? Could someone explain it?

    • @SQLBI
      @SQLBI  Před rokem

      When you use Date[Date], that is the internal conversion - the parameter is a table and it should be a list of dates. When you just provide a column reference, the remaining syntax is written for you automatically.

  • @Miche781
    @Miche781 Před 2 lety +1

    how amazon are these guys