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
AtchayaP
Helper V
Helper V

Dax

  • I have a string in a column , have to calculate average ? What method should use?

 

What is average x? Can you explain with easy example

3 REPLIES 3
v-henryk-mstf
Community Support
Community Support

Hi @AtchayaP ,

 

AVERAGEX: Returns the average of the expressions computed for each row of the table.

for example:

AVERAGEX(Sales, Sales[Quantity] * Sales[UnitPrice])

The formula calculates the average of the Sales table sales, where the sales are not the initial columns of the table, but are calculated by AVERAGEX.

 

You can count the number of different groups and find the average. See below:

Col =
VAR cur =
    CALCULATE (
        COUNTROWS ( 'Table' ),
        ALL ( 'Table' ),
        'Table'[Col] = EARLIER ( 'Table'[Col] )
    )
RETURN
    AVERAGEX ( 'Table', cur )

vhenrykmstf_0-1649142102481.png

 

If the problem is still not resolved, please provide test data and screenshots of the desired results. Looking forward to your reply.


Best Regards,
Henry


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@AtchayaP , Average of what for a string/text?

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

Text

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