Forum Discussion

socksinbox's avatar
socksinbox
Icon for Helper I rankHelper I
6 years ago
Solved

Filter visual by measure not working

Hi, I have one measure called "CustomerScore" which i want to filter by another measure (lastquarterscore). Everything seems to working fine but filterining not happening. I couldn't able to drage...
  • JarroVGIT's avatar
    JarroVGIT
    6 years ago

    Right I now understand what your issue is. You can fix that by creating a TRUE/FALSE column in your Calendar1 table like this:

    IsLastQuarter = 
    VAR _today = FILTER(ALL(Calendar1), Calendar1[Date] = TODAY())
    VAR prevQ = CALCULATETABLE(PREVIOUSQUARTER(Calendar1[Date]), _today)
    RETURN
    IF(Calendar1[Date] IN prevQ, TRUE, FALSE)

    Then filter your page on the column IsLastQuarter and then your datetable is always filtered to the last quarter.

    On your other question; PREVIOUSQUARTER() takes a table as input and TODAY() returns a datetime value and thus is not valid. A filtered table derived from Calendar1 is a valid input. Hope this helps you out!

     

    Kind regards

    Djerro123

    -------------------------------

    If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.

    Keep those thumbs up coming! 🙂