Forum Discussion
Net Login calculation
- 1 year ago
Thanks,
I got my answer with below mentioned syntax
Average Time W/O Aux = VAR FilteredTable = FILTER( 'One View Noida', 'One View Noida'[Net Login without Aux] <> TIME(0, 0, 0) ) VAR AvgTime = AVERAGEX( FilteredTable, 'One View Noida'[Net Login without Aux] ) RETURN FORMAT(AvgTime, "HH:MM:SS")Thanks
Hi sd0021781 Set the data type to Time. See image below:
Convert time to decimal either using power query or dax. I have used dax calculated column. See image below:
Write measure to find out average of the given timestamps. Try this:
AverageTimeDecimal =
VAR ATD = AVERAGEX(DateTable, DateTable[TimeInDecimal])
VAR AvgHour = INT(ATD)
VAR AvgMinute = INT((ATD - AvgHour) * 60)
VAR AvgSecond = ROUND((ATD - AvgHour - AvgMinute/60) * 3600, 0)
VAR Time = TIME(AvgHour, AvgMinute, AvgSecond)
VAR Result = FORMAT(Time, "hh:mm:ss AM/PM")
RETURN
ResultYou will get your desired output. See image below:
Hope this helps!!
If this solved your problem, please accept it as a solution!!
Best Regards,
Shahariar Hafiz
Thanks for your revert.
Please find below the error i can see.
- shafiz_p1 year agoSuper User
Remove extra brackets after AM/PM
- sd00217811 year agoRegular Visitor
removed the extra bracket. still their is no change
- shafiz_p1 year agoSuper User
again remove extra bracket ] in first line after 'One View Noida'[Net Login Without Aux]
You formula for measure may not work. As I can see that you have used original time column inside averagex. You first need to create a column to convert "Net Login without Aux] to TimeinDecimal.
Follow steps I have provided. To create column, see the image below:first click number 1 and then write formula in number 2. exactly same just need to change column name.
Hope this helps!!