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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
juanrivera63
New Member

Divide 2 columns in a measure, one of the columns is a string

I have 2 simple columns like below. Issue is that AVG is a text and I do not have access to change it to num in desktop. 

Quantity Avg
13020
1543
1904
60316
4500
6030
45027

 

I want to divide quantity / avg but bc avg is a text I cannot get the division working. 

Is there any way to divide this in a measure? 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@juanrivera63 , Try a measure like

 

Divide(sum(Table[quantity]), Sumx(Table, [Avg]*1)  )

 

Ideally in the column/measure tool, you should be able to change the data type

 

Data Format New Rib.png

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
juanrivera63
New Member

Hi @amitchandak , I am trying this in my regular query and it is giving me a cross join. 

amitchandak
Super User
Super User

@juanrivera63 , Try a measure like

 

Divide(sum(Table[quantity]), Sumx(Table, [Avg]*1)  )

 

Ideally in the column/measure tool, you should be able to change the data type

 

Data Format New Rib.png

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors