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.
Hello,
I have a realtively simple data set. Purchase order / Purchase Order Line / OT.
"OT" is a previously added column that checks whether or not the receipts against the line are "ONTIME" or "LATE"...
I would like to create a two new columns:
"LINE-OT" that tells me whether the PO LINE as a whole is either "ONTIME" (ie all "OT" against that line "ONTIME") or "LATE" (ie at least one "OT" against the PO line is "Late")
"PO-OT" that tells me whether all the POLINE on that PO are either "ONTIME" (ie all "LINEOT" are "ONTIME") or "LATE" (ie at least on "LINEOT" relating to the PO is "LATE")
Whats the best approach to this? I can add reasonably complicated condtional columns, but am unsure how to base the condition on a subset of data.
Thanks
Simon
Solved! Go to Solution.
@timealan , Both as new columns
PO Status =
var _late = countx(filter(table, [purchase_order] =earlier([purchase_order]) && [OT] = "LATE"),[purchase_order])+0
return
if(_late >0 , "LATE" , "ONTIME")
PO_LINE Status =
var _late = countx(filter(table, [purchase_order] =earlier([purchase_order]) && [PO_LINE] =earlier([PO_LINE]) && [OT] = "LATE"),[purchase_order])+0
return
if(_late >0 , "LATE" , "ONTIME")
Thank you very much. I tip my hat to you.
@timealan , Both as new columns
PO Status =
var _late = countx(filter(table, [purchase_order] =earlier([purchase_order]) && [OT] = "LATE"),[purchase_order])+0
return
if(_late >0 , "LATE" , "ONTIME")
PO_LINE Status =
var _late = countx(filter(table, [purchase_order] =earlier([purchase_order]) && [PO_LINE] =earlier([PO_LINE]) && [OT] = "LATE"),[purchase_order])+0
return
if(_late >0 , "LATE" , "ONTIME")
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
94 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |