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
Alejandro9805
New Member

SUMX HELP

Good morning,

 

I hope you can help me,

 

I created a measure to calculate the opportunity $ to fulfill pending orders, the items can be repeated in different orders, this makes that when I multiply the actual inventory by order to order, it doubles, triples the opportunity value, I tried to apply a filter, but the SUMX function does not allow me.

 

Is there any other way to do it?

 

DAX CODE When I multiply the value:

 

Opportunity $ = SUMX(Backorder,Backorder[B/O value] * RELATED('Inventory with location'[Qty on hand]))

 

DAX CODE:

Opportunity $ = SUMX(Backorder,Backorder[B/O value] * RELATED('Inventory with location'[Quantity available]),
FILTER(Backorder, Backorder[B/O qty] >= 'Inventory with location'[Qty on hand] ))}

 

Thanks for your help!

1 ACCEPTED SOLUTION

@Alejandro9805 I missed a comma:

Opportunity $ = 
  SUMX(
    FILTER(Backorder, Backorder[B/O qty] >= RELATED('Inventory with location'[Qty on hand]) ),
    Backorder[B/O value] * RELATED('Inventory with location'[Quantity available])
  )

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Greg_Deckler
Super User
Super User

@Alejandro9805 Try this:

 

Opportunity $ = 
  SUMX(
    FILTER(Backorder, Backorder[B/O qty] >= RELATED('Inventory with location'[Qty on hand]) )
    Backorder[B/O value] * RELATED('Inventory with location'[Quantity available])
  )

 

Otherwise, please post sample data and expected output


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler 

Thanks for you help,

 

I did what you said,

DAX CODE:

Opportunity $ = SUMX(
FILTER(Backorder,Backorder[B/O qty] >= RELATED('Inventory with location'[Qty on hand]) )
Backorder,Backorder[B/O value] * RELATED('Inventory with location'[Qty available])
)

Error:

"Backorder" syntax is not correct.(DAX(SUMX( FILTER(Backorder,Backorder[B/O cant.] >= RELATED('Inventory with location'[Quantity available]) ) Backorder,Backorder[B/O value] * RELATED('Inventory with location'[Quantity available])))).

 

Alejandro9805_0-1670336356356.png

 

Thanks for you help.

 

@Alejandro9805 I missed a comma:

Opportunity $ = 
  SUMX(
    FILTER(Backorder, Backorder[B/O qty] >= RELATED('Inventory with location'[Qty on hand]) ),
    Backorder[B/O value] * RELATED('Inventory with location'[Quantity available])
  )

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.