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
ThornTech
Frequent Visitor

Tracking peak Equity over time

I am working on a dashboard where I need to track the max value from the start of the data to now. The dataset has multiple strategies in it denoted by "StratID" (1000000, 2000000, 3000000, etc...

When I have a single strategy the formula below works fine, however, once I have multiple strategies I can't think of a way to make sure the Lookback period only goes to trade 1 of the current set.

It's like I need to group via the stratID apply the Max calc and then expand it back out.

I can do this via a measure as filters will separate out the values, but I really want it in the columns for other analysis I need to do down the line.

Any help would be great.

 

 

 

 

 

C_Peak Strat = 
CALCULATE (
    max ( [Balance] ),
    all(History),
    History[Trade ID] <= EARLIER ( History[Trade ID])
)

 

 

 

 

 



A sample of the data is below. Thanks
StratIDTrade IDBalance
10000001

10000

1000000210010
1000000310100
1000000410090
1000000510300
1000000610290
2000000120000
2000000220100
2000000320150
2000000420099
2000000520095
2000000620145
2000000720300
2000000820250
1 ACCEPTED SOLUTION
johnt75
Super User
Super User

You can use ALLEXCEPT,

C_Peak Strat =
CALCULATE (
    MAX ( [Balance] ),
    ALLEXCEPT ( History, History[StratID] ),
    History[Trade ID] <= EARLIER ( History[Trade ID] )
)

View solution in original post

2 REPLIES 2
ThornTech
Frequent Visitor

So simple when you know. Worked a treat, thanks for the quick reply.

johnt75
Super User
Super User

You can use ALLEXCEPT,

C_Peak Strat =
CALCULATE (
    MAX ( [Balance] ),
    ALLEXCEPT ( History, History[StratID] ),
    History[Trade ID] <= EARLIER ( History[Trade ID] )
)

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.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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