Forum Discussion
Dynamic Ranknumber
Hi
You can download the pbix file from the link below:
I need the measure "Rank" to rank the "Subcategorie" according to the measure "Verschil t.o.v. j-1".
This measure needs to work with filters from 4 different tables as you can see in the screenshot below.
But the tricky part is that I can not have gaps between the rank numbers and at this moment this is the case.
As you can see in the screenshot below the ranking works fine, but ranknumber 10 needs to be number 5 and ranknumber 11 needs to be number 6.
What I have already found out is that the DAX-formula I have used in the measure "Rank" works with almost every other measure. For example "Budget": no gaps in the ranknumbers:
I think the gaps are created because of this measure:
% Verschil t.o.v. j-1 = [% Aangerekend] - [% Aangerekend j-1]
% Aangerekend =
DIVIDE (
CALCULATE (
SUM ( Measuretable[Aangerekend] );
FILTER ( ALL ( Datum[Kwartaal] ); Datum[Kwartaal] <= MAX ( Datum[Kwartaal] ) )
);
[Budget]
)
% Aangerekend j-1 =
DIVIDE (
CALCULATE (
SUM ( Measuretable[Aangerekend] );
PREVIOUSYEAR ( Datum[Datum] );
FILTER ( ALL ( Datum[Kwartaal] ); Datum[kwartaal] <= MAX ( Datum[Kwartaal] ) )
);
CALCULATE (
[Budget];
PREVIOUSYEAR ( Datum[Datum] )
)
)
If I change the sign "-" into "*", the measure "Rank" works without showing any gaps in the ranknumber.
But ofcourse the output is not what I want as I want to use the sign "-". It's like DAX calculates 2 times and therefore creates 12 possible rankingnumbers instead of 6.
It would be extremely awesome if this could be fixed. I refuse to believe that it works for almost every measure except the one I need.
Friendly greets
Hi,
I tried but could not solve the problem. Sorry.
- svenvu7 years agoAdvocate I
Hi Ashish_Mathur or anyone else who knows RankX
I did some troubleshooting myself and I think I might know the source of the problem. For the positive numbers the ranking works great but as soon as there are negative numbers the RankX creates a gap between the ranknumbers
Does this help to find a solution?
Friendly greets