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
clewisWB
Regular 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
Regular Visitor

3 REPLIES 3
clewisWB
Regular Visitor

If anyone finds this then this helped me

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

 

 

v-jialongy-msft
Community Support
Community Support

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel

Power BI Monthly Update - May 2024

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