Forum Discussion

viniciusfigueir's avatar
viniciusfigueir
Frequent Visitor
6 years ago
Solved

Running Total with Slicer

I'd like to create a running total where I can filter the rows used by using a date slicer on another column. I have one data table with two columns, 'time' and 'dat', that looks like this: table_a ...
  • v-lili6-msft's avatar
    v-lili6-msft
    6 years ago

    hi viniciusfigueir 

    First, you should know that:

    1. Calculation column/table not support dynamic changed based on filter or slicer.
    2. Measure can be affected by filter/slicer, so you can use it to get dynamic summary result.

    https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/

    Second, Try these two measure that based on your column formula

    Count maeasure = CALCULATE(COUNTROWS(table_a), FILTER(ALLSELECTED(table_a), table_a[time] <= MAX(table_b[Value])))
    relative measure = [Count maeasure]/CALCULATE(MAXX(table_b,[Count maeasure]),ALLSELECTED(table_b))

     

    Regards,

    Lin