Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello, I want to calculate drawdown values for strategies which are grouped by date. Data looks like this:
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:
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.
How can I achieve this?
Any help is greatly appreciated it!
@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]) )
)
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:
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
79 | |
78 | |
58 | |
36 | |
33 |
User | Count |
---|---|
93 | |
59 | |
58 | |
49 | |
42 |