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
STS_Joshua
Helper II
Helper II

Help fine tuning IF and Calculate measure

Hi all, 

 

I'm looking for some help with a measure. I have a table that is showing a bunch of items on back order and would like to know how much of those items we can ship and how much money this would make. The table is built like so:

 

ItemInventoryOrder QtyTotal $$
Item 157$100
Item 227$100
Item 307$100
Item 41007$100
Item 557$100
Item 657$100

 

I have a measure that evaluates the quantities and if the ordered quanity is larger than the inventory, it will multiply the total order by that ratio, otherwise it will give the total amount:

ATShipqty = IF('OOBO'[openqtysum]>'OOBO'[onhandsum], ('OOBO'[onhandsum]/'OOBO'[openqtysum])*'OOBO'[BO$$], 'OOBO'[BO$$])
This gives me the table that I want:
ItemInventoryOrder QtyTotal $$Able to Release $$
Item 157$100$71.40
Item 227$100$28.60
Item 307$100$0
Item 41007$100$100
Item 557$100$71.40
Item 657$100$71.40
 11742$600$600

 

The problem is the end total because the total inventory is greater than the total order quantity so my measure will then just spit back the total order price. I need my measure to give me a sum total of the calculated available to release price, in this case $342.

 

Thanks in advance!

 

 

1 ACCEPTED SOLUTION
Aron_Moore
Solution Specialist
Solution Specialist

You should look at SUMX (there are other ...X formula too):

 

Capture.PNG

View solution in original post

1 REPLY 1
Aron_Moore
Solution Specialist
Solution Specialist

You should look at SUMX (there are other ...X formula too):

 

Capture.PNG

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.