Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
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])
)
StratID | Trade ID | Balance |
1000000 | 1 | 10000 |
1000000 | 2 | 10010 |
1000000 | 3 | 10100 |
1000000 | 4 | 10090 |
1000000 | 5 | 10300 |
1000000 | 6 | 10290 |
2000000 | 1 | 20000 |
2000000 | 2 | 20100 |
2000000 | 3 | 20150 |
2000000 | 4 | 20099 |
2000000 | 5 | 20095 |
2000000 | 6 | 20145 |
2000000 | 7 | 20300 |
2000000 | 8 | 20250 |
Solved! Go to Solution.
You can use ALLEXCEPT,
C_Peak Strat =
CALCULATE (
MAX ( [Balance] ),
ALLEXCEPT ( History, History[StratID] ),
History[Trade ID] <= EARLIER ( History[Trade ID] )
)
So simple when you know. Worked a treat, thanks for the quick reply.
You can use ALLEXCEPT,
C_Peak Strat =
CALCULATE (
MAX ( [Balance] ),
ALLEXCEPT ( History, History[StratID] ),
History[Trade ID] <= EARLIER ( History[Trade ID] )
)
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
86 | |
84 | |
66 | |
62 | |
59 |
User | Count |
---|---|
197 | |
118 | |
108 | |
78 | |
69 |