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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
kekepania0529
Helper I
Helper I

Excel SUMIFS conversion help

I have the following excel formula that I need to convert to DAX for Power BI (Power BI column names are in italics within the excel formula):

 

Area Contract Price = IFERROR(SUMIFS('Contract Details'!$Z:$Z Sell Extended Price,'Contract Details'!$D:$D Area,'Inbound Report'!$H14 Area,'Contract Details'!$L:$L Product Class,'Inbound Report'!$B14 Material Grade)/SUMIFS('Contract Details'!$Y:$Y Sell Order LB,'Contract Details'!$D:$D Area,'Inbound Report'!$H14 Area,'Contract Details'!$L:$L Product Class,'Inbound Report'!$B14 Material Grade),"")

 

Contract Details and Inbound Reports are unrelated tables in my Power BI report. I cannot create a relationship because neither table has a unique identifier (many:many). The join is on Inbound Report.Area = Contract Details.Area and Inbound Report.Material Grade = Contract Details.Product Class.

1 ACCEPTED SOLUTION
kekepania0529
Helper I
Helper I

i was able to get my desired results with this :

Area Contract Pricing = AVERAGEX(FILTER( 'Contract Detail','Contract Detail'[Area] = 'Inbound Detail'[Area] &&
          'Contract Detail'[Product Class Desc] = 'Inbound Detail'[Material Grade]), 
          DIVIDE('Contract Detail'[Sell Extended Price], 'Contract Detail'[Sell Ordered LB], 0))

View solution in original post

3 REPLIES 3
kekepania0529
Helper I
Helper I

i was able to get my desired results with this :

Area Contract Pricing = AVERAGEX(FILTER( 'Contract Detail','Contract Detail'[Area] = 'Inbound Detail'[Area] &&
          'Contract Detail'[Product Class Desc] = 'Inbound Detail'[Material Grade]), 
          DIVIDE('Contract Detail'[Sell Extended Price], 'Contract Detail'[Sell Ordered LB], 0))
AlexisOlson
Super User
Super User

SUMIFS is a sum of rows that satisfy the listed matching conditions.

 

In DAX, you can use filters in a similar way. This might work as a calculated column on 'Inbound Report'.

Numerator =
CALCULATE (
    SUM ( 'Contract Details'[Sell Extended Price] ),
    'Contract Details'[Area] = 'Inbound Report'[Area],
    'Contract Details'[Product Class] = 'Inbound Report'[Material Grade]
)

You can replace 'Inbound Report'[Area] and 'Inbound Report'[Material Grade] with specific values for this to work as a measure.

smpa01
Super User
Super User

@kekepania0529 not familiar with SUMIF. Can you provide sample data and expected output.

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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