Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I am still new to dax and working on solution for ranking a dataset based on filters user has made and then show the higest rank record in each category .
in below case , I want to rank person_no and p_type based on priority_no and only show those records which have rank =1 based on filter selected (filters can be worker_id ,org_id).
thanks in advance
a_id | person_no | p_type | priority_no | worker_id | org_id |
123 | 1 | M | 15 | ABC | 1 |
143 | 1 | M | 16 | ABC | 1 |
143 | 1 | N | 3 | ABC | 1 |
164 | 1 | N | 4 | ABC | 1 |
167 | 2 | M | 4 | ABC | 1 |
@Anonymous
Try the following formula to add the ranking:
Sorting Rank =
VAR current_person_no =
MAX ( Sheet1[person_no] )
VAR current_type =
MAX ( Sheet1[p_type] )
RETURN
RANKX (
FILTER (
ALLSELECTED ( Sheet1 ),
Sheet1[person_no] = current_person_no
&& Sheet1[p_type] = current_type
),
CALCULATE ( SUM ( Sheet1[priority_no] ) ),
,
DESC,
DENSE
)
Then on filter section filter when 'Sorting Rank' = 1
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
47 | |
26 | |
19 | |
15 | |
10 |
User | Count |
---|---|
57 | |
50 | |
44 | |
21 | |
19 |