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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Creating a table that summarises records per week and with top performers

I need to create a visual or table like the following:

scottcolbourne_0-1613794838502.png

I have an activities table with multiple columns, including:

Date

Person

activityid

Plus a date table with week end dates in it linked to the above date.

 

Now it is easy to list number of activities per person, but to show the TOP N, only works on the total, not on each week's totals.

 

To get a table to similar to above:

Do I need a summary table?

Also how do you list multiple people on one line?

Any ideas would be great for how I can get the top 3 for each given week.

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

You can use TOPN and CONCATENATEX to get your result.  For example,

 

Top Performers =
VAR vTop3 =
    TOPN (
        3,
        VALUES ( Table[Person] ),
        CALCULATE (
            DISTINCTCOUNT ( Table[ActivityID] )
        )DESC
    )
RETURN
    CONCATENATEX (
        vTop3,
        Table[Person],
        ", "
    )

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Share the raw dataset in a format that can be pasted in an Excel workbook.  Alternatively, share the link from where i can download your PBI file. 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
mahoneypat
Microsoft Employee
Microsoft Employee

You can use TOPN and CONCATENATEX to get your result.  For example,

 

Top Performers =
VAR vTop3 =
    TOPN (
        3,
        VALUES ( Table[Person] ),
        CALCULATE (
            DISTINCTCOUNT ( Table[ActivityID] )
        )DESC
    )
RETURN
    CONCATENATEX (
        vTop3,
        Table[Person],
        ", "
    )

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

Thank you Pat - that is great.  Strangely though it does not list them in descending order of number of activities.  The top 3 are correct though.  Any ideas why it is not ordering them in the concatenation in the descending order?

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors