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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Issue with something similar to Running Total

I have a unique request.  Here is the base setup - I have several sales order lines, each with a weight ordered amount for a particular product.  I also have a limited amount of available inventory to fill these orders.  Using predefined allocation rules I need to determine how many of these lines can be filled and apply conditional formatting to the lines in my table.  Green lines are those lines which can be filled and yellow for thise that can't be filled.  I have considered using a running total like scenario but can't build that logic.  Any thoughts and/or suggestions would be GREATLY appreciated!!

6 REPLIES 6
Anonymous
Not applicable

gjohnston2_0-1647291181796.png

 

Hi, @Anonymous 

 

You can try the following methods.

Measure = 
IF (
    CALCULATE (
        SUM ( Sales[Qty] ),
        FILTER ( ALL ( Sales ), [Qty] >= MAX ( Sales[Qty] ) )
    )
        < SELECTEDVALUE ( 'Available Inventory'[Weight] ),
    "Green",
    "Yellow"
)

Then apply Measure to the background color of each column in the conditional format.

vzhangti_3-1647423003146.pngvzhangti_2-1647422956439.png

The results are shown in the figure.

vzhangti_5-1647423079749.png

Is this the result you were expecting?

 

Best Regards,

Community Support Team _Charlotte

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

Anonymous
Not applicable

Thanks - unfortunately this isn't going to work.  The Qty is a 2 part calculation.  The available amount is a static number based on what is currently in inventory and the Needed Weight by Max Date is based on a selected date.  We have to use the Weight Needed by Max Date compared to the available inventory.
Part 1
Total Weight Needed:=Calculate(SUM('Sales Order Lines'[Lbs Ordered]),'Sales Order Lines'[Open to Fill] = 1)

Part 2
Weight Needed by Max Date:=
Calculate(Total Weight Needed],
       Filter(
       All('Date')
       'Date'[Date] <= MAX('Date'[Date])
       && 'Date'[Date]
              >=MAX('Date'[Date])-90
))

 

I tried to reproduce your solution and got an error - here is what I tried and the error I got

Can Be Filled =

IF(

Calculate(Weight Needed by Max Date],

      FILTER( ALL ('Sales Order Lines',[Weight Needed by Max Date] >= MAX ('Sales Order Lines'[Weight
      Needed by Max Date]))

)

      < SELECTEDVALUE(Available Inventory'[Weight],

      "Green",

      "Yellow"

)

 

I get this error

gjohnston2_0-1647448823649.png

 

Anonymous
Not applicable

Sorry - no colors came through - Happy Customer line should be green and the other 2 should be yellow.

Anonymous
Not applicable

Max Sales Order Date :3/15/2022 We are looking at any orders with line items that need to be filled before on an this date
        
        
Available Inventory  This is a list of available invnetory
ItemWeight      
ABCD5,500.00      
        
        
Current Demand  This is a list of Sales Orders with demand for the above item.  Green indicates it can be filled, Yellow indicates it can't be filled
Sales Order NumberCustomerItemRequested Ship DateQty  
SO12345Happy CustomerABCD3/14/20225000  
SO12346Not HappyABCD3/15/20221000  
SO12347Not HappyABCD3/15/2022750  
v-zhangti
Community Support
Community Support

Hi, @Anonymous 

 

Is it possible to provide some of the example data? And what do you expect the output to look like?

 

Best Regards

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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
Top Kudoed Authors