Forum Discussion
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!
| Product | Region | Price | IsSelected |
| A | America | 3 | 0 |
| A | Europe | 2 | 0 |
| B | America | 20 | 0 |
| B | Europe | 18 | 1 |
| B | Europe | 21 | 1 |
| B | Europe | 17 | 1 |
- Anonymous4 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
- amitchandakSuper User
Anonymous , if they (slicers) are from the same or connected table then
if(isblank(countrows(table)) ,0,1)
- AnonymousNot 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
- amitchandakSuper User
Anonymous ,Try like
If( Max(Table[Product]) in allselected(Table[Product]) && Max(Table[Region]) in allselected(Table[Region]) ,1, 0) +0
- AnonymousNot 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