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
Anonymous
Not applicable

[DAX] Sum top 3 values with a filter

Hello. I have been trying for the past day to solve this and could not get anywhere.

 

I recreated the data view into excel so I could change some sensitive data. Basically, the model gets data from multiple worksheets from multiple workbooks. In this query specifically, the model gets the percentage of ownership into the company (1 company = 1 workbook) for each one of the employees in that semester (the model is updated twice a year).

 

The worksheets are categorized. Suppose that worksheets 1, 2 and 3 belong to the same category. 

 

What I need to calculate is the average percentage that the top 3 shareholders have in that category:

-Filters by worksheet 1;
-Gets top 3 percentages in that worksheet and sums them; 
-Filters by worksheet 2;
-Gets top 3 percentages in that worksheet and sums them;
-...

I can later average them into the visual on the report view, but I am struggling to do both filters (by worksheet and top3). I've tried using CALCULATE, FILTER, TOPN, RANKX, SUMX...

Any help is appreciated! Thanks a lot.

 

power bi.PNG

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@Anonymous,

 

You may refer to the post below.

https://community.powerbi.com/t5/Desktop/Show-Top-N-values-only-in-a-new-table-monthly-average-of-daily/m-p/233772#M104113

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-chuncz-msft
Community Support
Community Support

@Anonymous,

 

You may refer to the post below.

https://community.powerbi.com/t5/Desktop/Show-Top-N-values-only-in-a-new-table-monthly-average-of-daily/m-p/233772#M104113

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.