Forum Discussion

Kurren's avatar
Kurren
Icon for Helper II rankHelper II
3 years ago

Remove row filter from table visual in a measure

I'm sure there is a simple answer that I can't find during my searching.

 

I have a table "Orders" which is being filtered by slicers. I want to add a column called "Total" which repeats the total order value.

Eg orders table:

 

Product, Qty, Value, Total

Pen, 5, $10, $14

Pencil, 10, $1, $14

Eraser, 3, $3, $14

 

Notice how total is the total value of all orders, but repeated. I want the Total measure to be affected by slicers applied to Orders, but unaffected by the row filter in the table. I also want the Total measure to be unaffected if I click a row of the table.

 

So far I have this:

CALCULATE(SUM('Orders'[Value]), REMOVEFILTERS('Orders'), KEEPFILTERS('Product'), KEEPFILTERS('...'), KEEPFILTERS('...'))
 
As you can see I have to repeat KEEPFITLERS for every slicer affecting the table. Is there a more elegant way?
 
Thanks

2 Replies

  • Hi! 
    Let me know if I misunderstood, but could ALLSELECTED() be something that helps?

    Total Value = 
    CALCULATE(
        sum('Orders'[Value]),
        ALLSELECTED('Orders'))

    Without slicer


    With slicer

     

     

    • Kurren's avatar
      Kurren
      Icon for Helper II rankHelper II

      Thanks, but if I click on a row then ALLSELECTED doesn't work.