Forum Discussion

cliang's avatar
cliang
Frequent Visitor
3 years ago
Solved

Card doesn't change when slicing

Hello,   I have a few cards that are using DAX formulas to filter values but when I slice the data using different slicers, sometimes it changes and sometimes it doesn't. I've tried two different m...
  • jdbuchanan71's avatar
    3 years ago

    cliang 

    When you use Students_SM1[STUDENT_STATUS] = "Active student" in a calcualte that overrides any filter you apply to the Students_SM1[STUDENT_STATUS] column so that is why your slicer is not working.  If you want to count only the actives and not show anything if you turn off actives you need to include a KEEPFILTERS like this:

    Count Active =
    CALCULATE (
        DISTINCTCOUNT ( Students_SM1[ID_KEY] ),
        KEEPFILTERS ( Students_SM1[STUDENT_STATUS] = "Active Student" )
    )