Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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]
)
Solved! Go to Solution.
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 )
)
Proud to be a Super User!
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 )
)
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.
User | Count |
---|---|
93 | |
84 | |
78 | |
75 | |
66 |
User | Count |
---|---|
115 | |
105 | |
93 | |
65 | |
60 |