cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
HadasSpier
Helper I
Helper I

DAX measure with time milliseconds

Hi everyone,

I use the following measure:

P95_min = VAR T= PERCENTILE.EXC(table[time field],0.95) VAR _H = HOUR(T) VAR _M = MINUTE(T) VAR _S = SECOND(T) return IF( _h <> 0, _H&"h ")& IF( _M <> 0, _M&"m ")& IF( _S <> 0 , _S& "s")


In the next column:

formated time
null
0.00:01:33.000
null
null
0.00:02:23.3128517
null
null
0.00:02:20.0291237
null
0.00:02:34.3919111
null
null
0.00:02:30.6005375
null
null
0.00:02:18.3312345

I get an error for this data (for bigger numbers- it works fine).
I did not find a built-in function that knows how to work with milliseconds.
Would appreciate the help.
Thanks in advance!

1 ACCEPTED SOLUTION
HadasSpier
Helper I
Helper I

I solved the problem.
I replaced the PERCENTILE.EXC function to PERCENTILE.INC and it worked.
Thank you all!

View solution in original post

4 REPLIES 4
HadasSpier
Helper I
Helper I

I solved the problem.
I replaced the PERCENTILE.EXC function to PERCENTILE.INC and it worked.
Thank you all!

View solution in original post

v-yuaj-msft
Community Support
Community Support

Hi @HadasSpier ,

 

Sorry for that the Time Type in power BI isn't existed millisecond and related functions. How did your data stored? If your records store with a common time format, it will remove milliseconds when you getting data and convert them to Power BI data model tables.

Can you share some screenshots around the issue please? This is not helping much.

 

Best Regards,

Yuna

GilbertQ
Super User II
Super User II

Hi @HadasSpier 

 

I have not seen any way in the past on how to get the milliseconds to work.


What I would suggest doing is to possibly put the milliseconds into another seperate column, which will allow you to calculate the milliseconds correctly and then you can update it in your existing measure?

 

A question I would have is are the milliseconds even required?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Hi GilbertQ!

Yes, milliseconds are required. But I can settle for an output of "less than a second", I tried and could not do it.

Thanks for your help!

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are You Ready?

Test your skills now with the Cloud Skills Challenge.

Top Solution Authors
Top Kudoed Authors