Forum Discussion
kk_shp_user
1 year agoHelper I
Computing Rank using 2 measures
I have a data model in which I have created two measures, m_personal_recruits -> tells how many recruits have been hired by a manager m_personal_recruit_qv -> tells how much sales the new recruits...
- 1 year ago
I think the id column is causing the issue. You'll need to add that to the ALLSELECTED, e.g.
Rank = VAR BaseTable = ADDCOLUMNS ( FILTER ( ADDCOLUMNS ( ALLSELECTED ( 'Table'[Manager], 'Table'[id] ), "@PersonalRecruits", [m_personal_recruits] ), [@PersonalRecruits] > 0 ), "@QV", [m_personal_recruits_qv] ) VAR Result = RANK ( BaseTable, ORDERBY ( [@PersonalRecruits], DESC, [@QV], DESC ) ) RETURN ResultYou'll also need to add any other columns from the same table which are in the visual.
kk_shp_user
1 year agoHelper I
Hi johnt75 ,
Thanks for this. The table is a huge one and so the query exceeds resources. Is there anyway to filter the data first to get only records that have [m_personal_recruits]>0 and then to rank?
I tried to filter within ALLSELECTED() but in vain.
Anonymous
1 year agoNot applicable
Hi kk_shp_user ,
Thank you for the follow up! To help us suggest the best approach, could you please share a small sample data and the DAX for your two measures? Also, a quick note on how your visual and filters are set up would really help us understand the scenario better to provide better solution.
Regards,
Pallavi.