Forum Discussion

Krissha's avatar
Krissha
Frequent Visitor
4 years ago
Solved

HELP: PROCUREMENT REBATES CALCULATION

Hi power user, 

 

Could you please help me on my powerbi. I'm a newbie user, I'm creating a procurement spend report and I want to show the actual rebates % and actual rebates amount based on a rebates structure.  I have 3 tables in my powerbi (1) Append Spend Supplier Details (2) Fiscal Calendar (3) Rebates Structure Table see attached file for table sample and below expected result. 

 

Fiscal Year NumberFiscal Period Business LineSupplier Parent Name USD Spend
202120212101WaterSupplier A100
202120212101TransporationSupplier A200
202120212101Construction ServicesSupplier B100
202120212101TransporationSupplier B50
202220222102Construction ServicesSupplier B50
202220222102WaterSupplier A400
202220222102TransporationSupplier B20
202220222102Construction ServicesSupplier A10

 

Suplier Parent Name Rebates %Minimum AmountMaximum Amount
Supplier A1%50199
Supplier A2%200$201 and above
Supplier B0%0100
Supplier B1%101$102 and above

 

Expected result are: 
Supplier parent name, fiscal year, actual rebates % and actual rebates amount 

Thank you

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Krissha ,

    I created a sample pbix file(see attachment) for you, please check whether that is what you want.

    Method 1: Create measures

    Actual rebates % = 
    CALCULATE (
        MAX ( 'Rebates Structure'[Rebates %] ),
        FILTER (
            ALL ( 'Rebates Structure' ),
            'Rebates Structure'[Minimum Amount]
                <= MIN ( 'Append Spend Supplier Details'[USD Spend] )
                && IF (
                    IFERROR ( SEARCH ( "and above", 'Rebates Structure'[Maximum Amount] ), 0 ) > 0,
                    1 = 1,
                    VALUE ( 'Rebates Structure'[Maximum Amount] )
                        >= MIN ( 'Append Spend Supplier Details'[USD Spend] )
                )
        )
    )
    Actual rebates amount = SELECTEDVALUE('Append Spend Supplier Details'[USD Spend])*[Actual rebates %]

    Method 2: Create calculated columns

    Column_Actual rebates % = 
    CALCULATE (
        MAX ( 'Rebates Structure'[Rebates %] ),
        FILTER (
            ALL ( 'Rebates Structure' ),
            'Rebates Structure'[Minimum Amount]
                <=  'Append Spend Supplier Details'[USD Spend] 
                && IF (
                    IFERROR ( SEARCH ( "and above", 'Rebates Structure'[Maximum Amount] ), 0 ) > 0,
                    1 = 1,
                    VALUE ( 'Rebates Structure'[Maximum Amount] )
                        >=  'Append Spend Supplier Details'[USD Spend] 
                )
        )
    )
    Column_Actual rebates amount = 'Append Spend Supplier Details'[USD Spend]*'Append Spend Supplier Details'[Column_Actual rebates %]

    Best Regards

3 Replies

  • Hi Krissha ,

     

    You refer you are adding a sample file however there is no file to download. Can you please share a mockup data or sample of your PBIX file. You can use a onedrive, google drive, we transfer or similar link to upload your files.

    If the information is sensitive please share it trough private message.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Krissha ,

    I created a sample pbix file(see attachment) for you, please check whether that is what you want.

    Method 1: Create measures

    Actual rebates % = 
    CALCULATE (
        MAX ( 'Rebates Structure'[Rebates %] ),
        FILTER (
            ALL ( 'Rebates Structure' ),
            'Rebates Structure'[Minimum Amount]
                <= MIN ( 'Append Spend Supplier Details'[USD Spend] )
                && IF (
                    IFERROR ( SEARCH ( "and above", 'Rebates Structure'[Maximum Amount] ), 0 ) > 0,
                    1 = 1,
                    VALUE ( 'Rebates Structure'[Maximum Amount] )
                        >= MIN ( 'Append Spend Supplier Details'[USD Spend] )
                )
        )
    )
    Actual rebates amount = SELECTEDVALUE('Append Spend Supplier Details'[USD Spend])*[Actual rebates %]

    Method 2: Create calculated columns

    Column_Actual rebates % = 
    CALCULATE (
        MAX ( 'Rebates Structure'[Rebates %] ),
        FILTER (
            ALL ( 'Rebates Structure' ),
            'Rebates Structure'[Minimum Amount]
                <=  'Append Spend Supplier Details'[USD Spend] 
                && IF (
                    IFERROR ( SEARCH ( "and above", 'Rebates Structure'[Maximum Amount] ), 0 ) > 0,
                    1 = 1,
                    VALUE ( 'Rebates Structure'[Maximum Amount] )
                        >=  'Append Spend Supplier Details'[USD Spend] 
                )
        )
    )
    Column_Actual rebates amount = 'Append Spend Supplier Details'[USD Spend]*'Append Spend Supplier Details'[Column_Actual rebates %]

    Best Regards

    • Krissha's avatar
      Krissha
      Frequent Visitor

      This works for me. super Thank you