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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Averages in Feet and Inches

Hey all, 

 

I currently am pulling in data from a web page that I am trying to create a measure for average of a category. Its current format is a text (Ex: 10' 8"). Any suggestions on how to make it a number that can produce an average since it is not possible to compute an average of text. Thanks!

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @Anonymous 

In Power Query, you can extract the feet and inches components of that text column using Extract feature under Add Column tab.

For Feet, that is Text Before Delimter where your delimeter is ' and for inches that is Text Between Delimeters where the first delimeter is a space and the second delimter is ". You will then need to change the data type of these newly created columns to numbers.
Alternatively you can use DAX to extract a string and convert them to numbers. Here are sample formulas.

Foot = 
VAR _singlequote =
    FIND ( "'", 'Table'[Column] ) - 1
RETURN
    VALUE ( LEFT ( 'Table'[Column], _singlequote ) )

Inch = 
VAR _singlequote =
    FIND ( " ", 'Table'[Column] ) + 1
VAR _doublequote =
    FIND ( """", 'Table'[Column] )
VAR __lenght = _doublequote - _singlequote
RETURN
    VALUE ( MID ( 'Table'[Column], _singlequote, __lenght ) )

  Here's a sample pbix for your reference: https://drive.google.com/file/d/1xoHmnqO8ieKHCkPb_lcEg2AwKQj0hiCg/view?usp=sharing 
You can then use these new columns in your aggregation (sum, average, etc)





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

1 REPLY 1
danextian
Super User
Super User

Hi @Anonymous 

In Power Query, you can extract the feet and inches components of that text column using Extract feature under Add Column tab.

For Feet, that is Text Before Delimter where your delimeter is ' and for inches that is Text Between Delimeters where the first delimeter is a space and the second delimter is ". You will then need to change the data type of these newly created columns to numbers.
Alternatively you can use DAX to extract a string and convert them to numbers. Here are sample formulas.

Foot = 
VAR _singlequote =
    FIND ( "'", 'Table'[Column] ) - 1
RETURN
    VALUE ( LEFT ( 'Table'[Column], _singlequote ) )

Inch = 
VAR _singlequote =
    FIND ( " ", 'Table'[Column] ) + 1
VAR _doublequote =
    FIND ( """", 'Table'[Column] )
VAR __lenght = _doublequote - _singlequote
RETURN
    VALUE ( MID ( 'Table'[Column], _singlequote, __lenght ) )

  Here's a sample pbix for your reference: https://drive.google.com/file/d/1xoHmnqO8ieKHCkPb_lcEg2AwKQj0hiCg/view?usp=sharing 
You can then use these new columns in your aggregation (sum, average, etc)





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.