Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Kumar11109
Helper IV
Helper IV

Ranking for Each Resource for each group

Dear All, 

 

I need to tag the number of times each resource is accessed by each.  This means that for each group, and for all the resources the tagging should start from 1. I am attaching an image of the data set. Each time a resource is accessed, its start time would change. 

 

Screenshot (48).png

 

1 ACCEPTED SOLUTION

HI @Kumar11109

 

You first need to add an INDEX column before you could do the RANKING

 

See the attached file with your data

 

Step # 1: Add Index Number

 

Index.png

 

Step#2 Ranking

 

Now you can RANK using this calculated column

 

RANK_ =
RANKX (
    FILTER (
        ALL ( Table1 ),
        Table1[GroupId] = EARLIER ( Table1[GroupId] )
            && Table1[ResourceId] = EARLIER ( Table1[ResourceId] )
    ),
    Table1[Index],
    ,
    ASC,
    DENSE
)

Regards
Zubair

Please try my custom visuals

View solution in original post

12 REPLIES 12
Abduvali
Skilled Sharer
Skilled Sharer

Hi @Kumar11109,

 

 

Create new measure using Rank function:

  • Rank = RANKX(ALL(A[Customer]), A[Total Sales], ,DESC)       //alter to your table and fields

 

Ranking customers by Sales valueRanking customers by Sales value

 If you would like to know more about Rank function refer to the link below:

 

Hope this helps.

 

Regards

Abduvali

NOPE, STILL THE SAME . :-c

@Kumar11109,

 

 

Can you give me some sample data? and I will help you out...

Here you go

 

Link

@Kumar11109,

 

I see whats happening, see the way you have your StartDate and EndDate there and they all Unique because of a time stamp!

  • but if you drop your date it will rank your Group by ResourcesID
  • or try to group your date by months:
    • Month = Month('final Score Table'[StartDateTime]) and then you this in your column

Capture47.PNG

 

Hope this explains the issue.

 

 

Regards

Abduvali

 

 

@Abduvali

 

Can you check the sheet again? I have done tagging for each resource, for each group. I need it in that form. I have done it on only first 100 rows. And I didn't understand the solution that you gave me. 

Another point I can't drop any column, I need them for other calculations. 

HI @Kumar11109

 

You first need to add an INDEX column before you could do the RANKING

 

See the attached file with your data

 

Step # 1: Add Index Number

 

Index.png

 

Step#2 Ranking

 

Now you can RANK using this calculated column

 

RANK_ =
RANKX (
    FILTER (
        ALL ( Table1 ),
        Table1[GroupId] = EARLIER ( Table1[GroupId] )
            && Table1[ResourceId] = EARLIER ( Table1[ResourceId] )
    ),
    Table1[Index],
    ,
    ASC,
    DENSE
)

Regards
Zubair

Please try my custom visuals
Anonymous
Not applicable

Hi @Zubair_Muhammad ,

 

Can you suggest how to add the column "RANK" in power query as indicated in image ?

 

 
 
 

Rank.png

 

@Kumar11109

 

See attached file here

 

(With your data)


Regards
Zubair

Please try my custom visuals

@Zubair_Muhammad

 

Thank You for your help. Now I am facing another problem. I need to create a scatter plot to check whether with each attempt students score is increasing or not. So for x axis, I need to put in the attempt number" 1,2,3,4....." and for the y axis, I need marks scored in that attempt. But the issue with Power bi is that its aggregating the attempt number( Rank) and the marks scored. I don't need aggregates but the option to don't summarize. How would be able to do that???

 

Thank You, 

 

@Abduvali

 

No, Screenshot (50).pngit's not working. I am getting the same rank value for all the groups and its resources. Look at the attached picture. 

 

 

 

@Kumar11109,

 

 

For rank to work you have to count the ResourceID's:

Rank = rankx(all 'Final Score Table'[GroupID], ---> here you need to add a measure that counts your ResourceID so create it something like ResourceID Count = COUNT('Final Score Table'[ResourceID]) and then use it in DAX formula:

 

  • Rank = RANKX(ALL( 'Final Score Table'[GroupID]),[ResourceID Count], , Desc)

 

This should work now.

 

 

Regards

Abduvali

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.