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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
CarlSagan
Helper I
Helper I

Pulling the value of RANKX on a drill through page

Hi all, 

 

I have a one to many relationship between a table called plans and a transaction table called assets. They are related by column planid. I want to rank the planids based on the sum amount of transactions. If i put the values into a matrix to see the data and sort by the sum of amount descending, the ranks are incrementing in a positive direction correctly but seem to be jumping values by one when I drill through. I'm using a simple measure of which uses a measure for summing the total. I'm using all to remove the filter context. Proof in the snips below

 

Assets Rank = 
RANKX(
    ALL(Plans),
    [Assets Total]
)

 

CarlSagan_0-1714492177694.pngCarlSagan_1-1714492267452.png

 



1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@CarlSagan,

 

The reason might be the use of ALL instead of ALLSELECTED.  A drill-through page would typically have filters inherited from the original page; ALLSELECTED would keep those filters intact. Also, you might try RANK instead of RANKX (RANK is preferred). Something like this:

 

Assets Rank =
RANK (
    DENSE,
    ALLSELECTED ( Plans ),
    ORDERBY ( [Assets Total], DESC, Plans[Plan ID], ASC )
)

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
DataInsights
Super User
Super User

@CarlSagan,

 

The reason might be the use of ALL instead of ALLSELECTED.  A drill-through page would typically have filters inherited from the original page; ALLSELECTED would keep those filters intact. Also, you might try RANK instead of RANKX (RANK is preferred). Something like this:

 

Assets Rank =
RANK (
    DENSE,
    ALLSELECTED ( Plans ),
    ORDERBY ( [Assets Total], DESC, Plans[Plan ID], ASC )
)

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




So ALLSELECTED with the RANK function didn't work, I'm thinking because it preseves all the filters, including the one on the current page (we don't want the current page's context to be included because it would make the current plan's assets equal to the max assets in the current filter context which is the current plans assets.)

But ALL with RANK seems to be working properly, I'm assuming because it doesn't preseve the above context from the visual. Regardless, your comment helped me get to the solution, so I well accept this as the answer.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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