Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi,
I try to make the difference between dates from the same column regarding statuts of an other column and for each Order_ID
I got an error message : "A table of multiple values was provided when a single value was expected."
Hi @I2SA ,
Based on your description, I wonder that you want to calculate the duration of the log from preparation to completion, I created simple samples and you may check the results below:
Measure = var _StartDate = CALCULATE(MIN('Table'[LOG_DATE]),FILTER('Table','Table'[STATUS]="pending_reception"))
var _EndDate = CALCULATE(MAX('Table'[LOG_DATE]),FILTER('Table','Table'[STATUS]="fulfilled"))
return
IF(not ISBLANK(_EndDate),DATEDIFF(_StartDate,_EndDate,DAY),0)
Please feel free to correct me and provide more information if I have misunderstood you!
An attachment for your reference. Hope it helps!
Best regards,
Community Support Team_ Scott Chang
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Thanks !
I think it's should work but I have an issue, for some cases I have several Fulfilled Dates for the same ID because I have log from different systems. I think I have to add an index in order to took the oldest one.
Do you know how to make this in Power Query ?
Hi @I2SA ,
You can try combining group by and index columns as needed.
Hope it helps!
Best regards,
Community Support Team_ Scott Chang
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Almost, in my case, in your example Order ID is 1 for all your lignes and you have the same sample for other Order IDs
Hi @I2SA ,
Based on your description, I made a new attempt and you can check the following results:
Measure =
VAR _AddColumn =
SUMMARIZE(
'Table',
'Table'[ORDER_ID],
"Mindate",
MINX (
FILTER ( ALL('Table'), [ORDER_ID] = EARLIER ( [ORDER_ID] ) && [STATUS] = "pending_reception" ),
[LOG_DATE]
),
"Maxdate",
MAXX (
FILTER (ALL('Table'), [ORDER_ID] = EARLIER ( [ORDER_ID]) && [STATUS] = "fulfilled" ),
[LOG_DATE]
)
)
VAR result =
ADDCOLUMNS ( _AddColumn, "result", DATEDIFF ( [Mindate], [Maxdate], DAY ) )
return
SUMX(result,[result])
An attachment for your reference. Hope it helps!
Best regards,
Community Support Team_ Scott Chang
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
What made you use LOOKUPVALUE for this?
I'am trying 🙂
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
71 | |
37 | |
21 | |
18 | |
15 |
User | Count |
---|---|
126 | |
32 | |
27 | |
24 | |
23 |