cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nickchobotar Established Member
Established Member

Re: Help with Measure

Hello,

 

@Zubair_Muhammad  very elegant solution. 

 

I took a longer path to the solution. Here is my take on this.

EVALUATE
SELECTCOLUMNS (
    ADDCOLUMNS (
        ADDCOLUMNS (
            Table1,
            "PreviousRow", CALCULATETABLE (
                VALUES ( Table1[Time Received] ),
                FILTER ( ALL ( Table1 ), Table1[Index] = EARLIER ( Table1[Index1] ) )
            )
        ),
        "Subtract", MINUTE ( ( Table1[Time Received] - [PreviousRow] ) )
    ),
    "Time Received", Table1[Time Received],
    "Action", Table1[Action],
    "Minutes Out", IF ( Table1[Action] = "Out", [Subtract], 0 )
)

image.png

 

Super User
Super User

Re: Help with Measure

Hi,

 

Format that column as a Time entry.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
ravsha85 Member
Member

Re: Help with Measure

Hi @erik_tarnvik

Thanks, I am getting the result now. But there is just one more thing, Is it Possible to get the exact time difference with Minutes and seconds(m.s) for eg. 4.50 where 4 is minute and 50 is seconds both of which is derived from the difference in date times.

 

Thanks,

Ravi Shankar D

erik_tarnvik Established Member
Established Member

Re: Help with Measure

Hi @ravsha85,

glad it worked out for you. For formatting the result, you may find these additional measures useful:

DiffMinutes = QUOTIENT([Diff], 60)

DiffSeconds = [Diff] - [DiffMinutes] * 60

DiffMinSec = [DiffMinutes] & "." & FORMAT([DiffSeconds],"00")

If all you need is the [DiffMinSec] you can fold it together as:

DiffMinSec = QUOTIENT([Diff], 60) & "." & FORMAT([Diff] - QUOTIENT([Diff], 60) * 60,"00")

View solution in original post

ravsha85 Member
Member

Re: Help with Measure

Thanks a lot @erik_tarnvik and everyone who helped in forming this calculation.

I will check and let you know if I find any bugs @erik_tarnvik

Highlighted
ravsha85 Member
Member

Re: Help with Measure

Hi @erik_tarnvik

Need one more help from you, the Diff measure is giving me the time difference perfectly but is it possible to get the total also. I also need to show the total time difference. Can you help me with this.

 

Thanks,

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 170 members 1,741 guests
Please welcome our newest community members: