Forum Discussion

NickAdmin2's avatar
NickAdmin2
Frequent Visitor
2 years ago
Solved

Sum But Exclude Only Some Filter Context

Hello, I'm sure this is a simple question to answer but I've looked everywhere and cannot understand what I'm doing wrong. I work for an RV manufacturer. I have fact data that includes Invoice ...
  • NickAdmin2's avatar
    NickAdmin2
    2 years ago

    Hi Rena,

    So that would be a solution and is one I hadn't thought of so thank you! I did manage to find a way to get it to work somehow with the following equation:

    Sum Of Sales Allowance v4 =
    CALCULATE(
        SUM(FT_Sales[LINEAMOUNT]),
        REMOVEFILTERS(FT_Sales),
        FT_Sales[SALESID] = SELECTEDVALUE(FT_Sales[SALESID]),
        FT_Sales[ITEMID] = "SA"
    )
     
    As far as I can tell, I've removed all the filters from my sales table - I had to do this because I needed to select line number 1 as my header line but couldn't sum information from other lines if this filter was here - then reinstated the filter on sales ID which makes sure I only grab the Sales Allowance record associated with any individual order, before applying a filter for the specific item i was looking for. 

    I appreciate you taking the time to look at and respond to my problem. I hope this helps anyone else looking to answer this problem.

    Cheers,
    Nick