March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi,
I would like to know how long in average it takes for an order to finalize.
I don't want to create a new table, I need it to be a measure. I tried to calculate the number of hours it takes for an order to complete, but I get the error "The value for 'Start' cannot be determined. Either the column doesn't exist, or there is no current row for this column."
Time to Complete Order =
VAR _ord = SELECTEDVALUE(order[ID])
VAR _tbl = ADDCOLUMNS(
SUMMARIZE(
order, order[ID]),
"Start",
CALCULATE(MINX(FILTER(order, order[Status] = "New1"),order[Created On])),
"End",
CALCULATE(MAXX(FILTER(order, order[Status] = "Complete1"),order[Created On]))
)
RETURN
DATEDIFF([Start],[End], Hour)
What am I doing wrong? How can I calculate the average time?
Solved! Go to Solution.
[Start] and [End] are columns in the _tbl variable. In this instance I think you want to use variables rather than a table, try
Time to complete =
AVERAGEX (
VALUES ( order[ID] ),
VAR Start =
CALCULATE ( MIN ( order[Created On] ), order[Status] = "New1" )
VAR End =
CALCULATE ( MAX ( order[Created On] ), order[Status] = "Complete1" )
RETURN
DATEDIFF ( Start, End, HOUR )
)
You can try like this
example below is your data you have
Create a measure like
[Start] and [End] are columns in the _tbl variable. In this instance I think you want to use variables rather than a table, try
Time to complete =
AVERAGEX (
VALUES ( order[ID] ),
VAR Start =
CALCULATE ( MIN ( order[Created On] ), order[Status] = "New1" )
VAR End =
CALCULATE ( MAX ( order[Created On] ), order[Status] = "Complete1" )
RETURN
DATEDIFF ( Start, End, HOUR )
)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
125 | |
80 | |
59 | |
57 | |
43 |
User | Count |
---|---|
186 | |
110 | |
82 | |
63 | |
50 |