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
datadelta
Helper III
Helper III

How can I use Averagex with char not var?

I'm trying to use this for items that have text not numbers.

Any thoughts would be appreciated!

 

AVERAGEX(
    KEEPFILTERS(VALUES('order_details'[productname]) AND 'order_details'[product_color]),
    CALCULATE(SUM('order_details'[order_amount]))
)
1 ACCEPTED SOLUTION
ToddChitt
Super User
Super User

AVERAGEX function (DAX) - DAX | Microsoft Learn

It is sort of assumed that when you are calculating an average, the column on which you make the caclulation is numeric in some way. 

 

What's the average of my colors? 

Doesn't really work, does it, becasue colors is not numeric.

 

Have you tried converting the number to something numeric? 

Are you getting an error message or pop-up on the formula? If so, can you paste in a screen shot?

Is [order_amount] the issue?




Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





View solution in original post

4 REPLIES 4
ToddChitt
Super User
Super User

Can't tell you how many times I have posted on this or other forums only to have the answer pop up or come to mind after I hit "Post".




Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





Thank you for sparking the thought!

ToddChitt
Super User
Super User

AVERAGEX function (DAX) - DAX | Microsoft Learn

It is sort of assumed that when you are calculating an average, the column on which you make the caclulation is numeric in some way. 

 

What's the average of my colors? 

Doesn't really work, does it, becasue colors is not numeric.

 

Have you tried converting the number to something numeric? 

Are you getting an error message or pop-up on the formula? If so, can you paste in a screen shot?

Is [order_amount] the issue?




Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





I wish I had thought that through... having a numeric representative may work.  

 

The error is, :  The function SUM cannot work with values of type string

 

Thanks!

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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