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.
I have a table with two columns, one with a name and another with a value (1 or 0).
I want to count the number of occurences of the value 1 to each name (that could be duplicate).
For example, I have this table
Name | Value |
A1 | 0 |
A1 | 1 |
A1 | 1 |
A2 | 0 |
A2 | 0 |
A3 | 1 |
A3 | 1 |
A4 | 0 |
A4 | 1 |
And I want to get something like this
Name | Value | Occurences |
A1 | 0 | 2 |
A1 | 1 | 2 |
A1 | 1 | 2 |
A2 | 0 | 0 |
A2 | 0 | 0 |
A3 | 1 | 1 |
A3 | 1 | 1 |
A4 | 0 | 1 |
A4 | 1 | 1 |
My goal is to use the result/calculated column as a slicer, with the number of occurences of 1's as options, to filter list of names.
I already created this DAX measure to do it but i can't use it as a slicer
rank = CALCULATE(COUNT(Table[Value]);FILTER(Table;Table[Value] = 1)).
Any suggest how can I work around this problem?
Thank you in advice!
Solved! Go to Solution.
try a measure
Occurences = CALCULATE(COUNTROWS(Table); ALLEXCEPT(Table; Table[Name]); Table[Value]=1)
User | Count |
---|---|
28 | |
11 | |
8 | |
6 | |
5 |
User | Count |
---|---|
35 | |
14 | |
12 | |
9 | |
7 |