Power BI datediff dax Usage with Example| How to calculate difference between two dates in power bi

Sdílet
Vložit
  • čas přidán 10. 07. 2024
  • #powerbi_training #powerbidax #dax #powerbi
    In todays video we take a look at the datediff dax function in Power BI. It's used to calculate the difference between two dates in Power BI. The syntax for datediff Dax function is : DATEDIFF(Date1, Date2, Interval).
    Explanation:
    Date1 is a scalar datetime value.
    Date2 is also a scalar datetime value.
    The Interval is used when comparing dates. The value can be one of the following:
    - SECOND
    - MINUTE
    - HOUR
    - DAY
    - WEEK
    - MONTH
    - QUARTER
    - YEAR
    Return value: The count of interval boundaries between two dates.
    This is a common task that you'll need to do when working with data in power bi.
    I'll give you an example to show you how to do the calculation, and then I'll explain the steps involved in more detail. After watching this video, you'll be able to calculate the difference between two dates in power bi easily and quickly!
    We will also see the usage of datediff dax function in terms of column and measure .
    The below are the actual dax written for the column and measure :
    1.Usage of datediff as Column in power bi :
    Time to Ship =
    DATEDIFF(FactInternetSales[OrderDate],FactInternetSales[ShipDate],DAY)
    2.Usage of datediff as measure in power bi :
    Avg Time to Ship =
    AVERAGEX(FactInternetSales,
    DATEDIFF(FactInternetSales[OrderDate],FactInternetSales[ShipDate],DAY)
    )
    Check out our other Power BI Tutorials Videos :
    1.SamePeriodLastYear with Example: • difference between par...
    2.How to Calculate Running Totals: • How to calculate runni...
    3.Duplicate Vs Reference : • power bi difference be...
    4.Merge Vs Append: • power bi difference be...
    5.Calculate Function in DAX Power BI: • What is Calculate Func...
    6.Filter Function in Power BI: • Filter Function in Pow...
    7.Row Vs Filter Context: • Row Context Vs Filter ...
    8.ALL DAX Function: • How to use ALL Dax Fun...
    9.ALL Vs ALLSELECTED : • allselected dax|all vs...
    10.ALL Vs ALLSELECTED VS ALLEXCEPT : • All Vs AllSelected Vs ...
    11.ALL Vs REMOVEFILTERS : • ALL Vs REMOVEFILTERS D...
    12.TOPN Dax Usage : • TOPN Dax | How to use ...
    13.Summarize Dax Function in Power BI: • summarize dax | How to...
    14.Summarize Vs Summarizecolumn : • summarize vs summarize...
    15.Calendar Vs CalendarAuto : • Calendar Vs Calendar A...
    16.How to create a date table in Power BI : • how to create a date t...
    17.How to calculate Running total for date values in Power BI
    • How to calculate Runni...
    18.How to calculate running total in power bi for non date values: • Running Total in Power...
    Learn Power BI through our vlog and Free Videos:
    powerbizone.com/category/arti...
    You can download the pbix file for your self practice sessions from :
    drive.google.com/file/d/137TL...
    Do not forget to Like ,Subscribe and comment which keeps me motivated !

Komentáře • 2