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
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
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.