The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi all,
I am trying to work this out for ages. I found many different solutions online, but nothing worked. It's a simple one table one slicer solution. I need to filter the ID by the selected rules in the slicer. PBI default is OR condition, but I need to change it to AND.
data:
IDRule
1 | a |
2 | a |
2 | b |
3 | c |
3 | a |
3 | d |
4 | b |
4 | a |
5 | b |
6 | d |
6 | e |
7 | d |
7 | e |
7 | a |
7 | f |
7 | g |
8 | d |
8 | a |
9 | e |
10 | a |
10 | d |
Thanks 🙂
Solved! Go to Solution.
@WOLFIE , Try Measure
measure =
var _cnt = calculate(DistinctCount('Table'[Rule]) ,allselected('Table'))
return
countx(filter(summarize('Table', 'Table'[ID], "_1", DistinctCount('Table'[Rule])),[_1]=_cnt),[ID])
or
measure =
var _cnt = calculate(DistinctCount('Table'[Rule]) ,allselected('Table'))
return
calculate(countx(filter(summarize('Table', 'Table'[ID], "_1", DistinctCount('Table'[Rule])),[_1]=_cnt),[ID]), filter(allselected(Table), Table[ID] =max(Table[ID])))
@amitchandak Quick additional question 🙂 I need the table to keep all values when nothing is selected in the slicer. I tried this, but it doesn't work:
@amitchandak Quick additional question 🙂 I need the table to keep all values when nothing is selected in the slicer. I tried this, but it doesn't work:
SOLVED 🙂
@WOLFIE , Try Measure
measure =
var _cnt = calculate(DistinctCount('Table'[Rule]) ,allselected('Table'))
return
countx(filter(summarize('Table', 'Table'[ID], "_1", DistinctCount('Table'[Rule])),[_1]=_cnt),[ID])
or
measure =
var _cnt = calculate(DistinctCount('Table'[Rule]) ,allselected('Table'))
return
calculate(countx(filter(summarize('Table', 'Table'[ID], "_1", DistinctCount('Table'[Rule])),[_1]=_cnt),[ID]), filter(allselected(Table), Table[ID] =max(Table[ID])))
The second one works! 🙂 Thanks so much!!!
User | Count |
---|---|
17 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
9 | |
8 |