Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Check if rows are selected

Hello guys,

 

I have a single Table that records sales transcations for "Products". In my dashboard there are slicers (for "Region" and "Product") that select a certain subset out of my list of transcations. For this subset, I want to check if the rows are selected.

 

Suppose, I slice for "Product B" and "Europe". Then the column IsSelected would look like in the table below.

 

How would you create the column IsSelected?

 

Thanks in advance!

ProductRegionPriceIsSelected
AAmerica30
AEurope20
BAmerica200
BEurope181
BEurope211
BEurope171
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous ,

     

    You will need to create two independent slicer tables and use them as slicers.

    slicer_p = DISTINCT('Table'[Product])
    slicer_R = DISTINCT('Table'[Region])
    Then create a measure as below.
    Measure = IF(SELECTEDVALUE('Table'[Product]) in VALUES(slicer_p[Product])&&SELECTEDVALUE('Table'[Region]) in VALUES(slicer_R[Region]),1,0)
     
    Best Regards,
    Jay

5 Replies

  • Anonymous , if they (slicers) are from the same or connected table then

     

    if(isblank(countrows(table)) ,0,1)

    • Anonymous's avatar
      Anonymous
      Not applicable

      amitchandak This command gives back a column with ones everywhere, although the slicers are connected to the table. This approach doesnt work for me

      • amitchandak's avatar
        amitchandak
        Super User

        Anonymous ,Try like

         

        If( Max(Table[Product])  in allselected(Table[Product])  && Max(Table[Region])  in allselected(Table[Region]) ,1, 0) +0

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    You will need to create two independent slicer tables and use them as slicers.

    slicer_p = DISTINCT('Table'[Product])
    slicer_R = DISTINCT('Table'[Region])
    Then create a measure as below.
    Measure = IF(SELECTEDVALUE('Table'[Product]) in VALUES(slicer_p[Product])&&SELECTEDVALUE('Table'[Region]) in VALUES(slicer_R[Region]),1,0)
     
    Best Regards,
    Jay