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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Luxsta85
New Member

Showing the Recent Quantity

Hi,

 

I'm having an issue showing the Quantity of stock due in on the Date it is due in. For example, we have a product 36965 which has 510 pieces due in on 14/03/24. However, on the Desktop board i have created it seems to combine quantities from 2 seperate dates and then displays them I need it to show the incoming quantity for the latest delivery date.

 

Luxsta85_0-1708007092948.pngLuxsta85_1-1708007108877.png

 

1 ACCEPTED SOLUTION

@Luxsta85 

my bad 

Expected Qty = 

var ds =  filter( 
    SUMMARIZE(
    Purchase_Order_Line_Excel,
     Purchase_Order_Line_Excel[ExpDate],
     Purchase_Order_Line_Excel[Exp Date],
     Purchase_Order_Line_Excel[Quantity]
    )
     ,  Purchase_Order_Line_Excel[exp date] <> "Delivered" ) 

var res = 
SELECTCOLUMNS(
index(
    1,
    ds,
    ORDERBY(Purchase_Order_Line_Excel[ExpDate],ASC)
),Purchase_Order_Line_Excel[Quantity])

return res

View solution in original post

7 REPLIES 7
Luxsta85
New Member

Absolute legend! That all worked a treat. Thank you very much!

Daniel29195
Super User
Super User

@Luxsta85 

NB : i notice that your dates are in datatype  general -->  convert the datatype to date .

try the following measure : 

Daniel29195_0-1708026758879.png

 

 

measure 1  : 

measure 1 = 

var ds =  filter( Table3 ,  Table3[exp date] <> "Delivered" ) 

var res = 

firstnonblank(ds , Table3[ExpDate])

return SELECTCOLUMNS(res,Table3[ExpDate])

 

 

 

let me know if this helps.

 

 

If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠

 

 

measure 2 

measure 2 = 

var ds =  filter( Table3 ,  Table3[exp date] <> "Delivered" ) 

var res = 

firstnonblank(ds , Table3[ExpDate])

return SELECTCOLUMNS(res,Table3[Quantity])

 

Hi @Daniel29195 

 

Thanks for you response!

 

That nearly worked, seems to be skippping the March date and showing May, can't figure out why.

 

Luxsta85_0-1708075061319.png

Luxsta85_1-1708075071478.png

 

 

@Luxsta85 

Daniel29195_0-1708087008154.png

 

 

measure 1 

Expected Del = 

var ds =  filter( 
    SUMMARIZE(
    Purchase_Order_Line_Excel,
     Purchase_Order_Line_Excel[ExpDate],
     Purchase_Order_Line_Excel[Exp Date]
    )
     ,  Purchase_Order_Line_Excel[exp date] <> "Delivered" ) 

var res = 
SELECTCOLUMNS(
index(
    1,
    ds,
    ORDERBY(Purchase_Order_Line_Excel[ExpDate],ASC)
),Purchase_Order_Line_Excel[ExpDate])

return res

 

 

 

measur 2 : 

Expected Del = 

var ds =  filter( 
    SUMMARIZE(
    Purchase_Order_Line_Excel,
     Purchase_Order_Line_Excel[ExpDate],
     Purchase_Order_Line_Excel[Exp Date]
    )
     ,  Purchase_Order_Line_Excel[exp date] <> "Delivered" ) 

var res = 
SELECTCOLUMNS(
index(
    1,
    ds,
    ORDERBY(Purchase_Order_Line_Excel[ExpDate],ASC)
),Purchase_Order_Line_Excel[ExpDate])

return res

 

 

 

 

 

let me know if this helps . 

 

 

 

 

If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠

Hi @Daniel29195,

 

Measure 2 seems to be the same as meaure 1

@Luxsta85 

my bad 

Expected Qty = 

var ds =  filter( 
    SUMMARIZE(
    Purchase_Order_Line_Excel,
     Purchase_Order_Line_Excel[ExpDate],
     Purchase_Order_Line_Excel[Exp Date],
     Purchase_Order_Line_Excel[Quantity]
    )
     ,  Purchase_Order_Line_Excel[exp date] <> "Delivered" ) 

var res = 
SELECTCOLUMNS(
index(
    1,
    ds,
    ORDERBY(Purchase_Order_Line_Excel[ExpDate],ASC)
),Purchase_Order_Line_Excel[Quantity])

return res

@Luxsta85 

could you please share the file to i can take a look ? 

because from my side, it works fine , 

Daniel29195_0-1708076897995.png

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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