Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
eunji888888
Frequent Visitor

Create Measure for maxx and selectedvalue

I have 3 Tables, My target is to create a special discount measure/column.

 

When the Billing Doc no. have the material which have the [netcase] greater than the scalavalue, then give the corresponding discount([amount]), only counting the larger scalevalue as may fulfill more than 2 discount. I am in trouble because the Material Group is not unique, the same GroupMaterial can have more than 1 Special Material and not sure how to select the larger scalevalue one only

 

I have try below but not work:

special discount column =
SUMX(
    FILTER(
        'Combined group discount',
        'Combined Group Discount'[ScaleValue] <
        MAXX(
            FILTER(
                'By SO',
             
                'By SO'[material] = 'Combined Group Discount'[Material Group.Material]
            ),
            'By SO'[NetCase]
        )
    ),
    'Combined group discount'[Amount]
)
 

Table1(the Material Group is not unique, the same GroupMaterial can have more than 1 Special Material. 

SpecialMaterial GroupMaterial

MO202409-21010771
MO202409-31010771
MO202409-51010772
MO202409-61010773

 

Table 2: 

SpecialMaterialGroupAmountScale

MO202409-383.00
MO202409-1103.00
MO202409-2103.00
MO202409-392.00
MO202409-11024.00
MO202409-182.00
MO202409-114.53.00
MO202409-210.72.00
MO202409-45.53.00
MO202409-58.68.00
4 REPLIES 4
v-priyankata
Community Support
Community Support

Hi @eunji888888 
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.
Thank you.

v-priyankata
Community Support
Community Support

Hi @eunji888888 
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.

v-priyankata
Community Support
Community Support

Hi @eunji888888 

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

anmolmalviya05
Super User
Super User

Hi @eunji888888,

Please try below measure:

Special Discount Measure =
VAR BillingDocMaterials =
VALUES('By SO'[Material]) -- Get all materials in the billing document

VAR DiscountTable =
ADDCOLUMNS(
FILTER(
'Combined Group Discount',
'Combined Group Discount'[ScaleValue] <=
MAXX(
FILTER(
'By SO',
'By SO'[Material] = 'Combined Group Discount'[Material Group.Material]
),
'By SO'[NetCase]
)
),
"MaxScaleValue",
MAXX(
FILTER(
'Combined Group Discount',
'Combined Group Discount'[Material Group.Material] = EARLIER('Combined Group Discount'[Material Group.Material])
),
'Combined Group Discount'[ScaleValue]
)
)

VAR MaxDiscountTable =
FILTER(DiscountTable, 'Combined Group Discount'[ScaleValue] = [MaxScaleValue])

RETURN
SUMX(MaxDiscountTable, 'Combined Group Discount'[Amount])

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors