Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi all, I would need to have an extra rank column for each criteria that is selected in the criteria filter.
Is that possible
Many thanks
David
Solved! Go to Solution.
Hi @ADP007 ,
We can create a calculate column and a measure to meet your requirement.
1. Create a rank column.
AVG. RANK =
RANKX(
FILTER(
mScoreData,
[CATEGORY]=EARLIER([CATEGORY])
&&[CRITERIA]=EARLIER([CRITERIA])
),
mScoreData[SCORE],,DESC,Dense)
2. Then create an average measure.
AVGRank =
var _total =
CALCULATE(
SUM(mScoreData[AVG. RANK]),
FILTER(
ALLSELECTED(mScoreData),
[CATEGORY]=MAX([CATEGORY])
&&[CATEGORY2]=MAX([CATEGORY2])
&&[MEDIA]=MAX([MEDIA])
&&[LABEL]=MAX([LABEL])))
var _count = CALCULATE(DISTINCTCOUNT(mScoreData[CRITERIA]),ALLSELECTED(mScoreData))
return
DIVIDE(_total,_count)
If you have any question, please kindly ask here and we will try to resolve it.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
BTW, pbix as attached.
Hi @ADP007 ,
Glad to hear that you have solved the issue.
Please kindly mark your reply as a solution to help others find it more quickly. Thanks!
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@ADP007 , Not very clear. You can not add a column when the filter is applied, You can change Rank calculation based on.
Please provide your feedback comments and advice for new videos
Tutorial Series Dax Vs SQL Direct Query PBI Tips
Appreciate your Kudos.
@amitchandak, thanks for your time. When I select items from the criteria filter the dimension gets added to the matrix.
In my image I have 4 criterias selected and thus 4 columns in my matrix table. I would like to have an extra column in the matrix for each dimension with the ranking. Something like this but of course dynamically. Hope this helps.
CATEGORY | SECTOR | BRAND | MEDIA | Convincing | Rank | Draws attention | Rank | Inspiring | Rank | Likeability | Rank |
Hi @ADP007 ,
We can create a measure and put it in Values to meet your requirement.
Rank =
RANKX (
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Media] = MAX ( 'Table'[Media] ) ),
CALCULATE ( SUM ( 'Table'[value] ) ),
,
ASC,
DENSE
)
If it doesn’t meet your requirement, could you please provide a mockup sample based on fake data?
It will be helpful if you can show us the exact expected result based on the tables.
Please upload your files to OneDrive For Business and share the link here. Please don't contain any Confidential Information or Real data in your reply.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
BTW, pbix as attached.
I have managed to place a rank column following your mockup. However I'm still stuck as I need to calculate a new column based on the various rank columns. In the image below I would need an order by which is the average rank for on line. For example line 1 would have an order by of 5.4 (6+6+4+6+5)/5. Is this possible?
Hi @ADP007 ,
We can create a calculate column and a measure to meet your requirement.
1. Create a rank column.
AVG. RANK =
RANKX(
FILTER(
mScoreData,
[CATEGORY]=EARLIER([CATEGORY])
&&[CRITERIA]=EARLIER([CRITERIA])
),
mScoreData[SCORE],,DESC,Dense)
2. Then create an average measure.
AVGRank =
var _total =
CALCULATE(
SUM(mScoreData[AVG. RANK]),
FILTER(
ALLSELECTED(mScoreData),
[CATEGORY]=MAX([CATEGORY])
&&[CATEGORY2]=MAX([CATEGORY2])
&&[MEDIA]=MAX([MEDIA])
&&[LABEL]=MAX([LABEL])))
var _count = CALCULATE(DISTINCTCOUNT(mScoreData[CRITERIA]),ALLSELECTED(mScoreData))
return
DIVIDE(_total,_count)
If you have any question, please kindly ask here and we will try to resolve it.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
BTW, pbix as attached.
So many thanks for your help, I don't use Power Bi enough or often enough.
I have three remarks:
Thanks
I understand why the rank was not correct. The matrix needs to be fully expanded for the rank to work.
So the only thing I need is to have this avr rang as a column. The reason is for the user to sort asc or desc on this value.
Thanks
D.
Hi, On holiday this week but will try and give an answer as soon as possible.
Thanks
Hi, Here is the link, hope it works : mScore
There is an xls file with what I'm trying to obtain.
Thanks for any help
David
User | Count |
---|---|
126 | |
108 | |
99 | |
65 | |
62 |
User | Count |
---|---|
137 | |
116 | |
102 | |
71 | |
61 |