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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
mherna5
Frequent Visitor

How to calculate drawdown for strategies grouped by date

Hello, I want to calculate drawdown values for strategies which are grouped by date. Data looks like this:

mherna5_0-1724180076050.png

 

I am using two tables: tbl_MTMResults & srt_Strategy with the following relationship (sorting table is used to slice other visuals too)

tbl_MTMResults[Strategy] *:1 srt_Strategy[Strategy]

 

Here is my DAX which calculates running total, peak of running total, and Drawdown (Running Total - Peak)

 

 

Calc RunningTot = //Running total for Price
CALCULATE(
    SUM(tbl_MTMResults[Price]),
    FILTER( ALLEXCEPT(tbl_MTMResults,srt_Strategy[Strategy]) , tbl_MTMResults[Date] <= MAX(tbl_MTMResults[Date]) )
)

 

 

 

Calc Peak = //Peak of RunningTotal through time
MAXX(
    ADDCOLUMNS(
        FILTER( ALLEXCEPT('tbl_MTMResults',srt_Strategy[Strategy]) , tbl_MTMResults[Date] <= MAX(tbl_MTMResults[Date]) ),
        "RunningTotal", [Calc RunningTot]
    ),
    [RunningTotal]
)
Calc Drawdown = [Calc RunningTot] - [Calc Peak]

 

 

These are the results along with the expected:

mherna5_1-1724180843058.png

 

Problem: The total Drawdown for 8/2 is $2,717 while the totals per Strategies on 8/2 dont add up to this number. 

In order for strategy drawdowns to add up to this date total we must use the peak running total per date, in this case it is from 8/1 (highlighted in yellow below). Now the running total for Orange on 8/2 is $107,391 but the peak (which is from 8/1) is $98,490. Difference is $8,901 which is what we expect and our strategy totals now add up to the date total.

mherna5_2-1724181826450.png

 

How can I achieve this?

Any help is greatly appreciated it!

2 REPLIES 2
amitchandak
Super User
Super User

@mherna5 , Try one of the two

 

Calc RunningTot = //Running total for Price
CALCULATE(
SUM(tbl_MTMResults[Price]),
FILTER( ALLEXCEPT(tbl_MTMResults,tbl_MTMResults[Date]) , tbl_MTMResults[Date] <= MAX(tbl_MTMResults[Date]) )
)

 

Or

 

Calc RunningTot = //Running total for Price
CALCULATE(
SUM(tbl_MTMResults[Price]),
FILTER( allselected(tbl_MTMResults) , tbl_MTMResults[Date] <= MAX(tbl_MTMResults[Date]) )
)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak , thanks for replying.

 

On the first calculation I received the error: A single value for column cannot be determined

On the second, values are not broken down to the strategy:

mherna5_1-1724251915015.png

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.