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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
clewisWB
Frequent Visitor

Power BI slicers, Dates and Ranks

I have 1 slicer slecting 2024 and a second selecting April from a calendar which is linked to my main table

I have the following Measure

 

RankxSelected =
RANKX(
    ALLSELECTED(consolidated_reporting_data[positionNovusSecurityName.value]),
    CALCULATE([Total PnL %]), , DESC, Dense)

 

The following table is the output

Name pnl long/Short RankxSelected
stockA 20 L 1
stockB 19 L 2
stockC 18 L 3
stockD 17 S 1
stockE 16 L 4
stockF 15 S 2
stockG 14 S 3
stockH 13 S 3
stockI 12 L 5
stockJ 11 L 6
stockK 10 S 4
stockL 9 L 7

 

I am trying to get the following

Name pnl long/Short RankxSelected
stockA 20 L 1
stockB 19 L 2
stockC 18 L 3
stockD 17 S 4
stockE 16 L 5
stockF 15 S 6
stockG 14 S 7
stockH 13 S 8
stockI 12 L 9
stockJ 11 L 10
stockK 10 S 11
stockL 9 L 12

 

Any ideas to help would be great thank you

1 ACCEPTED SOLUTION
clewisWB
Frequent Visitor

3 REPLIES 3
clewisWB
Frequent Visitor

If anyone finds this then this helped me

https://www.youtube.com/watch?v=tS1ff6ouORg

 

 

Anonymous
Not applicable

Hi @clewisWB 

 

I've made a little change to your measure and it should work for you.

RankxSelected =
RANKX(
    ALL(consolidated_reporting_data[positionNovusSecurityName.value]),
    CALCULATE([Total PnL %]), , DESC, Dense)

 

 

 

 

 

Best Regards,

Jayleny

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi, thanks for the reply.

 

The change makes no difference to the output

 

The value of the Long/short column seems to be where the rank "restarts" and am unsure how to overcome that

 

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

May 2025 Monthly Update

Fabric Community Update - May 2025

Find out what's new and trending in the Fabric community.