Forum Discussion

Usix's avatar
Usix
Frequent Visitor
9 months ago
Solved

Removefilters, all, keepfilters behavior

Hi all, I have 2 tables  > Employees withs 2023 & 2024 salaries > a sample of employees ID on which I want to filter my visual   Both have an active relationship on employee ID   The visual I w...
  • amitchandak's avatar
    9 months ago

    Usix , All or remove filter should be used on a column in this case like 
    Same job family = CALCULATE(
    [Evolution],
    ALL('2023 2024'[Job Family])
    ))

    KEEPFILTERS- Prevents CALCULATE from expanding the filter to ALL Job Families- refer -https://www.sqlbi.com/articles/using-keepfilters-in-dax/


    for removing blank try 

    Same job family =
    IF(
        ISBLANK(SELECTEDVALUE('emp filters'[ID])),
        BLANK(),
        CALCULATE(
            [Evolution],
            ALL('2023 2024'),
            KEEPFILTERS(VALUES('2023 2024'[Job Family]))
        )
    )