Forum Discussion
MAXX measure wrong value
6 Replies
- Ray_MindsSolution Supplier
Hi eunji888888
I have tried to replicate your scenario which is as follows:1. By SO table
2. Combined Group Discount table
By looking at the above sample data I provided for both tables, we can deduce:
(I) For Material A, max value will be 25 (Extracted from Discount field).
(II) For Material B, max value will be 30 (Extracted from Discount field).
(III) For Material C, max value will be 20 (Extracted from Discount field).
Visual Output :
For A
For B
For C
Matching as expected. In my model, I am utilizing a bridge table to establish a relationship between the 'By So' and 'Combine Group Discount' tables, as I anticipate that both tables contain duplicate values in the material column. If you could kindly share a sample dataset along with the relationships you have defined, it would greatly facilitate troubleshooting and help us resolve the issue more efficiently. Thank you!
If your requirement is solved, please make THIS ANSWER a SOLUTION ✔️ and help other users find the solution quickly. Please hit the LIKE 👍 button if this comment helps you. - Akash_VarunaSuper 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" )- eunji888888Frequent Visitor
I have tried your measure, but it does not change the result
- AnonymousNot applicable
Hi eunji888888,
Just following up to see if the solution provided was helpful in resolving your issue. Please feel free to let us know if you need any further assistance.
If the response addressed your query, kindly mark it as Accepted Solution and click Yes if you found it helpful — this will benefit others in the community as well.
Best regards,
Prasanna Kumar
- AnonymousNot applicable
Hi eunji888888,
We wanted to kindly check in to see if everything is working as expected after trying the suggested solution. If there’s anything else we can assist with, please don’t hesitate to ask.
If the issue is resolved, we’d appreciate it if you could mark the helpful reply as Accepted Solution — it helps others who might face a similar issue.
Warm regards,
Prasanna Kumar
- AnonymousNot applicable
Hi eunji888888,
Just a gentle reminder — has your issue been resolved? If so, we’d be grateful if you could mark the solution that worked as Accepted Solution, or feel free to share your own if you found a different fix.
This not only closes the loop on your query but also helps others in the community solve similar issues faster.
Thank you for your time and feedback!
Best,
Prasanna Kumar