+ Reply to Thread
Results 1 to 2 of 2

DAX running total using CALCULATE ( FILTER (ALL

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

    DAX running total using CALCULATE ( FILTER (ALL

    Hello all I've been trying to get used to uisng the syntax of nesting the Filter and All functions inside Calculate , as this seems to be the correct thing to do rather than just using the CALCULATE 'built in filter.

    I have two measures for a running total month by month ;

    This is how I orignialy would have entered it and it understands the filter context when a 'criteria' is dropped into the pivot table.
    < trytwo:=VAR ddate = MAX(Table1[Date]) RETURN

    CALCULATE(SUM(Table1[number]),Table1[Date]<= ddate && Table1[Date]> EOMONTH(ddate,-1)) >

    This is how I've been trying to write it

    <
    < CALCULATE(SUM(Table1[number]),

    FILTER(ALL(Table1),Table1[Date]<= sdate && Table1[Date]> EOMONTH(sdate,-1))) >

    The problem I've come across is that this does not recognize the criteria when in a pivot table? how can I correct this, I appreciate both may be useful but I'd like to know how to control it better.

    I've attached a very (very) simple workbook with a p table showing the difference . Any help or pointer gratefully recieived.

    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,911

    Re: DAX running total using CALCULATE ( FILTER (ALL

    Your ALL is explicitly removing any filters applied, thereby causing your problem. You want ALL(Table1[Date]) to only remove any date filters
    Last edited by rorya; 03-29-2022 at 10:05 AM.
    Rory

+ 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. How to calculate running total + total remaining in a pivot?
    By Traste in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 11-03-2017, 10:41 AM
  2. [SOLVED] How do I calculate a running total
    By toddp2 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-21-2017, 03:57 AM
  3. How to calculate running total?
    By andy_2016 in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 11-04-2016, 11:31 AM
  4. [SOLVED] Calculate running total
    By bigband1 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2015, 05:43 PM
  5. [SOLVED] Calculate a running total
    By tapsmiled in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-05-2014, 09:13 PM
  6. Calculate Running Total In PivotTable
    By bookstorelee in forum Excel General
    Replies: 0
    Last Post: 02-25-2011, 06:07 AM
  7. Ignore #N/A to calculate running total
    By Rockter in forum Excel General
    Replies: 7
    Last Post: 05-22-2007, 01:12 PM

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