Forum Discussion

Clax's avatar
Clax
New Member
2 years ago
Solved

How to catch the value from a slicer

Hello all, I have a table with cities and I want to obtain the same table without the value selected on a single-selection slicer.    What I have             -        What I want          ...
  • JamesFR06's avatar
    JamesFR06
    2 years ago

    No my mistake sorry.

    This code works at my place

    FilteredCiud =
    var selectciduad=SELECTEDVALUE(Villes[Ciudades])
    var t2=CALCULATETABLE(Villes,Villes[Ciudades]=selectciduad)
    var t3=CALCULATETABLE(Villes,all(Villes))
    var filteredtowns=EXCEPT(t3,t2)
    return
    COUNTROWS(filteredtowns)
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Clax ,
    Thanks to Nithinr  for the solution.
    Here's another one of my solutions.
    Here some steps that I want to share, you can check them if they suitable for your requirement.
    Here is my test data:

    Create a calculated table

    Table 2 = VALUES('Table'[Country])

    Create a measure

    Measure = 
    CALCULATE(
        COUNTX('Table','Table'[Country]),
        FILTER(
            'Table',
            'Table'[Country] <> SELECTEDVALUE('Table 2'[Country])
        )
    )

    Apply the measure to the filter on this visual to the table view and set the value as "is 1"

    Drag the table 2 into the slicer
    Final output

     

    Best regards,

    Albert He

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly