Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
odzelashvili1
Helper I
Helper I

Time difference measure by one column

Hello PBI community 🙂

 

My table has this view:

odzelashvili1_0-1629377204026.png

 

I want to see what is difference between VISIT_CREATE and VISIT_END.

 

For this task, I'm using DATEDIFF function, which really works:

odzelashvili1_1-1629377411841.png

 

Now, I want to see total average time difference for all visits in one visual, but, when I put my measure into card, PBI gives me wrong result.

 

In my table screen, visit_key 1 time difference is 24s, for 2 - 2,126s and average must be 1,075s, but my measure says it is 2,126s 😞 

 

 

Have any idea how to solve this task?

 

 

 

Thanks in advance!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@odzelashvili1 , Try a measure like

 

AverageX(Values(MainTable[Visit ID]), [WD_create_to_end])

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@odzelashvili1 , Try a measure like

 

AverageX(Values(MainTable[Visit ID]), [WD_create_to_end])

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I have one very stupid question, 

 

when I'm using code like this:

odzelashvili1_0-1629884480117.png

and then this:

odzelashvili1_1-1629884507461.png

it works, but it does not work when I'm using this code:

odzelashvili1_2-1629884575856.png

Can anyone tell me, what's wrong with second code?

 

 

thanks 🙂

I understand reason 🙂

 

odzelashvili1_0-1629889116227.png

 

 

thanks anyway

Thank you very much 🙂 it works!

 

Can you explane what really does this measure? I dont want to copy+paste, I want to understand how it works 🙂 Thanks again

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.

Top Kudoed Authors