Forum Discussion

Asky82's avatar
Asky82
Frequent Visitor
4 years ago
Solved

Use single filter to affect multiple columns

Hi,   I'm new to PowerBI and have been scouring the web trying to find an answer to my problem but to no avail!     In summary I would like to use a single filter to affect 2 columns in my datase...
  • johnt75's avatar
    johnt75
    4 years ago

    I think you need to modify the measures which you are putting onto the visuals to incorporate the filter. You can amend them to be along the lines of

    Filtered Measure = 
    var slicerDate = value(format(SELECTEDVALUE('DateFilter'[Date]),"YYYYMMDD"))
    return
    IF ( SELECTEDVALUE('EDW FactDebtFollowUpContact'[SeqFollowUpDateKey]) <= slicerDate && SELECTEDVALUE('EDW FactDebtFollowUpContact'[SeqClearingCutOffDateKey]) > slicerDate, 1,0 )
    return CALCULATE(
    original measure definition,
    FILTER('EDW FactDebtFollowUpContact',
    'EDW FactDebtFollowUpContact'[SeqFollowUpDateKey] <= slicerDate && 'EDW FactDebtFollowUpContact'[SeqClearingCutOffDateKey] > slicerDate
    )