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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
RPAI2812
Helper I
Helper I

Replace values based on function

Hi, I have a column from a table that the database is not following a standard as from picture below. I need to have the time information in hours as a number, but the person that fills the database sometime fills with strings such as "h" for hours and "min" for minutes. I would like to create a function in PQ that transforms these cases of texts to the correct number value. In other words, I would like to change "h" for a comma, erase the word num and the value of minutes I would have to divide by 60 to have its decimal values in hours.

 

I am not very much familiar with coding in PQ, so I kindly ask someone's help 🙂

 

RPAI2812_0-1634910506837.png

 

1 ACCEPTED SOLUTION
smpa01
Super User
Super User

@RPAI2812  in PQ replace "h" with comma(,) and then split on first delimiter (,)

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

View solution in original post

2 REPLIES 2
smpa01
Super User
Super User

@RPAI2812  in PQ replace "h" with comma(,) and then split on first delimiter (,)

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
RPAI2812
Helper I
Helper I

An additional relevant information is that I don't have access to edit the database

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors
Top Kudoed Authors