+ Reply to Thread
Results 1 to 3 of 3

DAX Time intelligence functions

  1. #1
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    610

    DAX Time intelligence functions

    Hi,

    Can someone help or point me in the direction of information re time intelligence, and how they work in relation to the 'calendar date' table and the date table coming from a fact or dim table.


    I have two very similar measures ;


    Please Login or Register  to view this content.
    this is using the dats from the sales order date column and seems to work fine with a pivot created using that date table.

    this


    Please Login or Register  to view this content.

    this does not work even though the only thing changed is the number and type of period?
    if i re write using calendar dates and create pivot uinng those dates it woks fine, but then I can't use a measure such as ;

    Rolling 3 day total:=VAR mdate = MAX(fSales[Order Date])
    RETURN
    SUMX(FILTER(ALL(fSales[Order Date]),fSales[Order Date]<= mdate &&
    fSales[Order Date] > mdate - 3 ),[sSales] ),

    In fact I 'd be interested to know if there's a way of writing this using the 'Calendar Date' table. I've attached a very simple workbook, showing the two pivots and the above measures.

    Richard.
    Attached Files Attached Files

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,908

    Re: DAX Time intelligence functions

    You've grouped by order month, so there is no data one month back due to filter context.

    If you want to use the calendar date table you should use the calendar date fields, then something like:

    =VAR todate = MAX('Calendar'[Date])
    VAR fromDate = toDate - 3
    RETURN
    CALCULATE([sSales],fSales[Order Date]<=todate&&fSales[Order Date]>fromDate,ALL('Calendar'))

    should work, but it will display all dates for which that measure calculates a value, which will tend to include at least two dates for which you don't have orders (unless you have orders for every day in a month)
    Rory

  3. #3
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    610

    Re: DAX Time intelligence functions

    Thanks, works fine, as you said returns where there are not orders, but it's still correct and you can use an if you only want it to work
    where there are values you can finish with an if statement,

    Please Login or Register  to view this content.
    I need to spend more time on this,

    Richard.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 08-03-2022, 06:32 AM
  2. Replies: 0
    Last Post: 08-03-2022, 06:32 AM
  3. I need a forum for SAP Business Intelligence Objects
    By Rick-O-Shay in forum The Water Cooler
    Replies: 0
    Last Post: 06-02-2020, 06:17 PM
  4. AI (artificial intelligence) to analyse data
    By excelnabb in forum Excel General
    Replies: 4
    Last Post: 04-26-2019, 08:37 AM
  5. A challenging business intelligence issue with subtotals
    By larrygoldstein in forum Excel General
    Replies: 4
    Last Post: 09-15-2014, 10:34 AM
  6. business intelligence using excel
    By sowherdo in forum Excel General
    Replies: 1
    Last Post: 06-27-2013, 09:33 AM
  7. Adding intelligence to data validations
    By ValentineNicole in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-21-2010, 06:22 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1