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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Xilitor01
Helper III
Helper III

Convert date to whole number

Hi,

 

I am trying to extract the price from Excel into PowerBI but it keeps reading the data as a date. Can anyone help me with getting PowerBI to read the prices correctly? Thank you 🙂

 

Excel-data:

Xilitor01_0-1629190386103.png

 

PowerBI reads it as:

Xilitor01_1-1629190461162.png

 

But I want it to be like:

Xilitor01_2-1629190476412.png

 

 

1 ACCEPTED SOLUTION

Hi  @Xilitor01 ,

 

Using below M codes:

= Table.AddColumn(#"Promoted Headers", "Custom", each 24*Number.From([Price]))

And you will see:

vkellymsft_2-1629347793866.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

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

 

View solution in original post

4 REPLIES 4
selimovd
Super User
Super User

Hey @Xilitor01 ,

 

in Power Query add a step where you replace ":00:00" with ".00".

Afterwards transform to a decimal number, that should do it.

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

Thank you for your response.

 

I do the following steps:

Xilitor01_0-1629191500482.png

 

Xilitor01_1-1629191511387.png

 

 

But as you can see the numbers are incorrect.

 

Let me know if I do something incorrectly.

Hi  @Xilitor01 ,

 

Using below M codes:

= Table.AddColumn(#"Promoted Headers", "Custom", each 24*Number.From([Price]))

And you will see:

vkellymsft_2-1629347793866.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

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

 

Thank you - it worked 🙂

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.