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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
pankajj
Helper III
Helper III

Partial received quantity to be deducting from the Order quantity till full quantity received

Hi Team of Experts!

 

I need help in displaying Stock Alert.

 

My data sample and expected result is as follows:

 

ORDER-LINEORDER QTYDemand_OrderALLOTTED_QTYQTY_DIFFERENCEPROMISE DATESupply_DateStock AlertMessage
SO-AB1234/1100SO-AB1234/12080April01 2020March10 2020EarlyPartial Quantity (20) Arriving Early on March10 2020 for SO-AB1234/1
SO-AB1234/1 SO-AB1234/13050April01 2020March20 2020EarlyPartial Quantity (30) Arriving Early on March20 2020 for SO-AB1234/1
SO-AB1234/1 SO-AB1234/14010April01 2020April20 2020LatePartial Quantity (40) Arriving Late on April20 2020 for SO-AB1234/1
SO-AB1234/1 SO-AB1234/1100April01 2020May15 2020LateFinal Quantity (10) Arriving Late on May15 2020 for SO-AB1234/1

 

My following Query is giving me error.

 

if[TOTAL_SHIPPED_QTY]>=[ORDER_QTY]
then "FULL QUANTITY SHIPPED" else
if[Supply_Date]<> null then if([QTY_DIFFERENCE]>0
and
[REMAIN_QTY]=[ALLOTTED_QTY]) then
"Full Quantity" & "(" & Number.ToText[ALLOTTED_QTY] & ")" & " Arriving on" & " " & [Supply_Date] & " " & "for" & [#"ORDER-LINE"] else

if([REMAIN_QTY]>[ALLOTTED_QTY]) and [QTY_DIFFERENCE]>0 then
"Partial Quantity" & "(" & Number.ToText[ALLOTTED_QTY] & ")" & " Arriving on" & " " & [Supply_Date] & " " & "for" & [#"ORDER-LINE"] else

if([REMAIN_QTY]>[ALLOTTED_QTY]) and [QTY_DIFFERENCE] = 0 then
"Final Quantity" & "(" & Number.ToText[ALLOTTED_QTY] & ")" & " Arriving on" & " " & [Supply_Date] & " " & "for" & [#"ORDER-LINE"]

else "NO SUPPLY DATE"
else
[Stock Alert]

 

Will really appreciate kind support of the great community.

 

Thanks & Best regards,

 

PG

1 REPLY 1
amitchandak
Super User
Super User

If in power Bi comes in ()  and and is && and Or is ||

Corrected the formula, But you need to rework on the logic still

if([TOTAL_SHIPPED_QTY]>=[ORDER_QTY]
, "FULL QUANTITY SHIPPED" ,
	if([Supply_Date]<> null,
		if([QTY_DIFFERENCE]>0
		&& [REMAIN_QTY]=[ALLOTTED_QTY]) &&  "Full Quantity" & "(" & Number.ToText[ALLOTTED_QTY] & ")" & " Arriving on" & " " & [Supply_Date] & " " & "for" & [#"ORDER-LINE"] ,
			if([REMAIN_QTY]>[ALLOTTED_QTY] && [QTY_DIFFERENCE]>0 ,
				"Partial Quantity" & "(" & Number.ToText[ALLOTTED_QTY] & ")" & " Arriving on" & " " & [Supply_Date] & " " & "for" & [#"ORDER-LINE"] ,
					if([REMAIN_QTY]>[ALLOTTED_QTY] && [QTY_DIFFERENCE] = 0 &&
						"Final Quantity" & "(" & Number.ToText[ALLOTTED_QTY] & ")" & " Arriving on" & " " & [Supply_Date] & " " & "for" & [#"ORDER-LINE"]

, "NO SUPPLY DATE")
else
[Stock Alert])))

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

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