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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

PowerBi Dax code to replicate excel sumif

I am looking to calculate

'supplier = (sum of group 1 x weighting) + (sum of group 2 x weighting).

 

In excel I use 2 tables to calculate, but struggling to figure this out in powerbi so far

 

I am currently using PowerBi to create Averages of scores per supplier.

 

I am now trying to moved towards weighted totals and weighted averages.

 

 

 

group Totals.jpg

 

Supplier Totals.jpg

 

In my scenario I have

    8 Divisions
    22 Groups (of suppliers ie. Joint Ventures, multiple Suppliers working on a contract)
    8 Individual Suppliers made up of a percentage of a group of suppliers.

 

 

 


Within Excel, I have created a supplier list 1-8 which uses a sum if from another table.

 


```
SUMIFS('Group Totals (Per)'!F:F,'Group Totals (Per)'!$B:$B,$B2)

```


This other table is a sumif of group name, division multiplied by weighting (percentage of the contract)

```
SUM(SUMIFS(Payments!$I:$I,Payments!$C:$C,'Group Totals'!$A7,Payments!$B:$B,'Group Totals'!F$1)*$C7)
```

 

 

My hope is to replicate this within power BI.

So I can click select a supplier and see the total payments received (which will be a sum of a percentage of the group contract (joint ventures).

However I have been unable to separate out the suppliers totals with weighting, after creating links tables.

I have supplied sample data in excel and power BI and screenshots.

 

Here's a link to the files https://tinyurl.com/y43as4dr

 
1 ACCEPTED SOLUTION
dax
Community Support
Community Support

Hi Oneill1,

It seems that you want to calculate result  like below

95.png

If so, you could try to modify relationship like below

96.png

Then create a table like below

table =
SUMMARIZE (
    'Supplier Groups Weight',
    Suppliers[Supplier Name],
    'Supplier Groups Weight'[Weight],
    "payment", SUM ( Payments[Payment Amount     ] ),
    "total", MIN ( 'Supplier Groups Weight'[Weight] ) * SUM ( Payments[Payment Amount     ] )
)

97.png

Create a measure like below

Measure 3 = CALCULATE(SUM('table'[total]))

98.png

Best Regards,

Zoe Zhi

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

3 REPLIES 3
dax
Community Support
Community Support

Hi Oneill1,

It seems that you want to calculate result  like below

95.png

If so, you could try to modify relationship like below

96.png

Then create a table like below

table =
SUMMARIZE (
    'Supplier Groups Weight',
    Suppliers[Supplier Name],
    'Supplier Groups Weight'[Weight],
    "payment", SUM ( Payments[Payment Amount     ] ),
    "total", MIN ( 'Supplier Groups Weight'[Weight] ) * SUM ( Payments[Payment Amount     ] )
)

97.png

Create a measure like below

Measure 3 = CALCULATE(SUM('table'[total]))

98.png

Best Regards,

Zoe Zhi

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Anonymous
Not applicable

Hi zoe

After looking again it takes the full division total when I introduce slices.

Would I need to create a new calculated table that breaks total by division and group, linking supplier weighting table and then calculate individual supplier totals.

My aim is to be able to slice by division and supplier. Producing a table with the report which displays the groups "contracts" they are receiving payments.

Using a manually created to verify the figures they arent matching.

I read in another post this may not be possible, which has led me down the calculated table theory.
Anonymous
Not applicable

Thank you so much, this has cracked it.

 

I had got to a supplier level or division level, but not being able to use a slicer to incorpate the division level. But the mutiple direction relationships appears to have solved that. 

 

Thank you again

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors