cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Anonymous
Not applicable

"1a" text can be convert in integer

Hi,

 

I tested some values to convert and I saw that value("1a") return an integer, it works for all numbers (between 0 and 24) and "a".

for example : 1a = 0.04

5a = 0.21

But "a" only is not a value and "1b" doesn't work.

 

Do you know why ?

Thank you,

 

Regards,

Loveboch

1 ACCEPTED SOLUTION

You can use VALUE to convert a string to a datetime.

Writing 0a is interpreted as 0am, 1a is like 1am, and so on (I just discovered it - I didn't know that you can shorten am/pm into a/p).

You can also write 1p, which is like 1pm.

In a datetime the hour is a fraction of a day, so 1am is 1/24. If you write 0a and 12a you get always 0, but if you write 13a is like 1p, which is 13/24.

I hope it helps!

 

Marco

 

View solution in original post

5 REPLIES 5

You can use VALUE to convert a string to a datetime.

Writing 0a is interpreted as 0am, 1a is like 1am, and so on (I just discovered it - I didn't know that you can shorten am/pm into a/p).

You can also write 1p, which is like 1pm.

In a datetime the hour is a fraction of a day, so 1am is 1/24. If you write 0a and 12a you get always 0, but if you write 13a is like 1p, which is 13/24.

I hope it helps!

 

Marco

 

harshnathani
Community Champion
Community Champion

HI @Anonymous ,

 

Sounds strange

 

Can you share the results of the calculation.

 

How did you canvert 1a into an integer an it returned 0.04.

 

Regards,


Regards,

Harsh Nathani


Appreciate with a Kudos!! (Click the Thumbs Up Button)


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

@harshnathani - VALUE("1a") returns 0.04 and then you can keep on replacing 1 with any number between 1 - 23 including 23. Not sure why it happens.

Thanks @AntrikshSharma ,

 

Not sure why. 

 

Probably ask @marcorusso 

 

Regards,

Harsh Nathani

Yup only DAX gods can help now!

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors