cancel
Showing results for
Did you mean:

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Frequent Visitor

## Top N and "Other" drill down

I have a Matrix with monthly values and a list of Clients.  I need the Top 10 and Other.  I also need to be able to drill down into each Client and add the employee who attributes values to the total for the month.  My Top 10 works well using the Ranking.

When I add the Employee to the Row to drill down, I no longer see the Top 10.  How can I keep it to the Top 10 & Other?

Here is my Ranking Measure:

Ranking 2023 =
VAR HoursToRank = [TopN Value]
VAR Ranking =
RANKX(
ALLSELECTED(Clients_Other[Clients]),
[2023TotalHrs]
)
VAR IsOtherSelected = SELECTEDVALUE('Clients_Other'[Clients]) = "Others"
VAR Result =
IF(
IsOtherSelected,
HoursToRank + 1,
IF(Ranking <= HoursToRank, Ranking, Ranking + 1)
)
RETURN
Result

Here are my values for a given month:
2024_06 =
VAR HoursOfAll =
CALCULATE('TableValues'[2024_06Hrs],REMOVEFILTERS(Clients_Other[Clients]))
RETURN
IF(
ISINSCOPE(Clients_Other[Clients]),
VAR ClientToRank = 'TopN'[TopN Value]
VAR IsOtherSelected = SELECTEDVALUE(Clients_Other[Clients]) = "Others"
VAR ClientsWithHoursAmt =
ALLSELECTED(Clients_Other[Clients])
,"@Amt", ([2024_06Hrs])
)
Var Top15Clients = TOPN(ClientToRank,ClientsWithHoursAmt,[@Amt])
VAR HoursOfTop15 = SUMX(Top15Clients,[@Amt])
VAR Result = IF(IsOtherSelected,HoursOfAll - HoursOfTop15, [2024_06Hrs])
RETURN Result,
HoursOfAll
)

2 REPLIES 2
Super User

you probbaly don't want to have to specify all these different values separately. Better to use a single measure.

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Frequent Visitor

My data is located here:

https://www.dropbox.com/scl/fo/dbf1f6kiuzmge3ietar3w/h?rlkey=9pqlz66wiwxmn04kyf6zrr2xt&dl=0

I'd like the matrix to look like the following if you drill into Client.  My goal is to show TopN Clients (eg. 3) and then all other clients should fall into to the Other bucket.  When a user clicks on Client, they should be able to see Emps with values that make up the Client Total.    Other needs to be the last line or under the Top N Clients.  In my example I have Rankin Asc order so that the Client with the largest Total is listed first.

Announcements

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

#### Power BI Monthly Update - May 2024

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

#### Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors