Forum Discussion
eunji888888
1 year agoFrequent Visitor
MAXX measure wrong value
I found that there is a mistaken value in the MAXX function. The maxx gives all the same value, 24, which is the maximum for the whole list instead of filtering the selected material. Are there an...
Akash_Varuna
1 year agoSuper User
Hi eunji888888 Try adding this in the filter after Value 'Combined Group Discount'[Material Group.Material] = CurrentMaterial inside calculate here is the full code
Discount Measure =
VAR CurrentMaterial = SELECTEDVALUE('By SO'[Material])
VAR CurrentNetCase = SUM('By SO'[NetCase])
VAR CurrentBillingDocNo = SELECTEDVALUE('By SO'[BillingDocNo])
VAR FilteredScalarValue =
CALCULATE(
MAXX(
FILTER(
'Combined Group Discount',
'Combined Group Discount'[Material Group.Material] = CurrentMaterial
),
VALUE(RIGHT(
'Combined Group Discount'[Column],
LEN('Combined Group Discount'[Column]) - FIND("_", 'Combined Group Discount'[Column])
))
),
'Combined Group Discount'[Material Group.Material] = CurrentMaterial//Explicily add this
)
VAR IsScalarValueFound = NOT(ISBLANK(FilteredScalarValue))
RETURN
IF(
IsScalarValueFound && CurrentNetCase >= FilteredScalarValue,
"apply", // Replace with your discount logic
"No Discount"
)eunji888888
1 year agoFrequent Visitor
I have tried your measure, but it does not change the result