Forum Discussion
Finding Max Value
- 8 years ago
Hi varunv11
The calculated column you want to add is really just the maximum value so far in the P/L $ column.
You could use a DAX calculated column like this:
Max so far = VAR CurrentDateTime = Data[Date] + Data[Time] RETURN CALCULATE ( MAX ( Data[P/L $] ), ALL ( Data ), FILTER ( ALL ( Data[Date], Data[Time] ), Data[Date] + Data[Time] <= CurrentDateTime ) )Regards,
Owen
Thanks quentin_vigne
I did that but the requirement is to find max of PL value with the above value on the other column.
This is more like running total but here we are looking for max value between 2 values.
Please advise.
Warm Regards
Varun Raj
Hello,
I think your requirement isn't absolutely clear.
If you search Max depending on specfic value you need
MaxOfValue=CALCULATE(MAX([SearchColumn]),FILTER(Table,[FactColumn]=SearchValue))
If you just want to find the maximum value quentin_vigne is absolutely correct.
Please give us a more precise example with your expected result.
Best regards.
- varunv118 years agoFrequent Visitor
Hello Floriankx
The requirement is to find the Max value from 2 columns, like we do cumulative total or the running total (current cell added with the above cell to give running balance).
In the below screenshot, i need to find max of column C2 with column D1. The result for the requirement is highlighted in yellow.
Please advise.
Warm Regards
Varun Raj
- OwenAuger8 years agoSuper User
Hi varunv11
The calculated column you want to add is really just the maximum value so far in the P/L $ column.
You could use a DAX calculated column like this:
Max so far = VAR CurrentDateTime = Data[Date] + Data[Time] RETURN CALCULATE ( MAX ( Data[P/L $] ), ALL ( Data ), FILTER ( ALL ( Data[Date], Data[Time] ), Data[Date] + Data[Time] <= CurrentDateTime ) )Regards,
Owen
- Floriankx8 years agoSolution Sage
Hello,
in this case calculated colum should be fine, but D1 can't be calculated dynamically as far as I know.
So you could either use a helper table to provide this Value or you have to type it.
Column=MAX([P/L $],[CompareValue])