+ Reply to Thread
Results 1 to 7 of 7

DAX running total that has condition Filter

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

    DAX running total that has condition Filter

    Hi,
    I've been trying to see how to create a formula in DAX where the internal formula filter is not over ridden by the external in
    pivot table, at least I think that is what's happening.

    I've used 'VALUES' which works for one column condition, but if I'm using an index column to create running total and then
    want another criteria I get stuck, I've tried ALLSELECTED, and nesting another filter.

    This is more of a learning process than a real life problem, any suggestions welcome.

    Workbook and test file containing what i used attached.
    Attached Files Attached Files

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: DAX running total that has condition Filter

    Hi,

    You haven't included your expected results, so it's difficult to know how to help you.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

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

    Re: DAX running total that has condition Filter

    Sorry,
    I'd like the running total column in the pivot table to respect the pivot table category and only show for , in this case category 'a',
    so I would have a running total for 'a' but noting for b and c. The 'values' function nearly helps, but I can't use the 'values' function as it only take one column, and I need to work on two one for category and one for creating a running total, I've used index rather than date.

    Hope that helps,

    Richard.

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: DAX running total that has condition Filter

    So it would show blanks for the other categories? And how is the choice of Category to "be respected" to be determined? Or is this fixed, i.e. always 'a'?

    Regards

  5. #5
    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 running total that has condition Filter

    Pending you replies to XOR's questions, something like this might give you some pointers:

    =VAR currIndex = MAX(Table1[index])
    return CALCULATE(SUM(Table1[Units]),KEEPFILTERS(Table1[Stuff]= "a"),Table1[Index]<=currIndex)
    Rory

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

    Re: DAX running total that has condition Filter

    Thank you Rory, exactly and thank you also XOR, I had been trying with 'keepfilters' but only used them for first
    time yesterday. Am I right in thinking that in for example; CALCULATE(FUNCTION, FILTER (ALL(TABLE[ROW] ;

    the filtered information is sent to calculate which performs imposes context transition and then that is fed
    to the actual function, sum for example.


    Richard.

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

    Re: DAX running total that has condition Filter

    Thank you for your help and taking time to answer,

    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. DAX running total using CALCULATE ( FILTER (ALL
    By Dicken in forum Office 365
    Replies: 1
    Last Post: 03-29-2022, 09:57 AM
  2. Replies: 4
    Last Post: 04-26-2021, 11:13 AM
  3. Replies: 3
    Last Post: 05-31-2019, 09:21 AM
  4. Running total after payments running total on excel
    By tmagplayr in forum Excel General
    Replies: 7
    Last Post: 09-26-2017, 02:01 PM
  5. Replies: 8
    Last Post: 07-19-2017, 12:06 PM
  6. [SOLVED] Running total from a daliy worksheet into a montly total.
    By jakesib in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-15-2014, 10:49 PM
  7. Pivot Chart Running Total - Removing Current Year Future Total
    By car3489 in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 07-27-2013, 03:35 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