Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I am needing a calculation to get the average time in location between rows in groups. Below is the current data structure and desired output.
Data:
| JOB | LOCATION | TIME |
| 1 | a | 8/21/2021 |
| 1 | b | 8/22/2021 |
| 1 | c | 8/23/2021 |
| 1 | d | 8/24/2021 |
| 2 | a | 8/21/2021 |
| 2 | b | 8/22/2021 |
| 2 | c | 8/23/2021 |
| 2 | d | 8/24/2021 |
Output:
| Location | Average Time(Days) In location |
| a | |
| b | |
| c | |
| d |
Hi, @Tripb44
try to create a measure like this
_date =
DATE(1899,12,30)+AVERAGE('Table'[TIME])
result:
Please refer to the attachment below for details. Hope this helps.
If I did not understand your question correctly, please consdier sharing more details about it.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Tripb44 Maybe:
Measure =
VAR __Table = ADDCOLUMNS(SUMMARIZE('Data',[LOCATION],[JOB],"__Max",MAX('Data'[TIME]),"__Min",MIN('Data'[TIME])),"__Duration",([__Max] - [__Min]) *1.)
RETURN
AVERAGEX(__Table,[__Duration])
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 46 | |
| 43 | |
| 39 | |
| 19 | |
| 15 |
| User | Count |
|---|---|
| 68 | |
| 65 | |
| 31 | |
| 28 | |
| 24 |