Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
13 | |
11 | |
9 | |
6 |