Forum Discussion
ellengrace2293
8 years agoFrequent Visitor
Using a Max value in a IF statement for graph
Hello! Let's say I have a query with the following columns: [Date], [ID], [Flow], and [Overflow]. I need to have another column (or measure) that mostly equals the [Flow] value, except when [Flow] fo...
- Anonymous8 years ago
This calculated column is what you were trying to write
calculated column = var currentID = [ID] var maxFlow = CALCULATE( MAX('Flow Data'[Flow]), ALL('Flow Data'), 'Flow Data'[ID] = currentID ) RETURN IF( AND( [Flow] = maxFlow, [Overflow] > [Flow] ) [Overflow], [Flow] )
Anonymous
8 years agoNot applicable
This calculated column is what you were trying to write
calculated column =
var currentID = [ID]
var maxFlow = CALCULATE(
MAX('Flow Data'[Flow]),
ALL('Flow Data'),
'Flow Data'[ID] = currentID
)
RETURN
IF(
AND(
[Flow] = maxFlow,
[Overflow] > [Flow]
)
[Overflow],
[Flow]
)- ellengrace22938 years agoFrequent Visitor
Thank you for the quick answer! That worked great. I have a lot to learn about DAX.