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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Arioli_Chezhian
Helper II
Helper II

How to get average of text column?

Hi All,

I have a column which has 'user name' and it's datatype is 'text'. Currently I am showing the data in card visual which shows distinctcount of username.

However, I would like to show 'Average of number of users'. Since it is in text datatype, could you please advice on how to write the measure to achieve this scenario?

E.g. data:

Username
abc
def
ghi
1 ACCEPTED SOLUTION

@Arioli_Chezhian  This measure for example will calculate the average number of products, year over year. I recommend trying quick measures to learn things like this.

Average # of Products YOY =
AVERAGEX(
    KEEPFILTERS(VALUES('Date Table'[Year])),
    CALCULATE(COUNTA('Sheet1'[Product]))
)
bchager6_1-1715529479142.png

 


 

View solution in original post

5 REPLIES 5
bchager6
Super User
Super User

@Arioli_Chezhian  What would your average be based on? For example, average number of users over time or average sales by user.

 

@bchager6  - In a card visual, just need to show the Average of number of users. May be you can consider as average number of users over time.

@Arioli_Chezhian  This measure for example will calculate the average number of products, year over year. I recommend trying quick measures to learn things like this.

Average # of Products YOY =
AVERAGEX(
    KEEPFILTERS(VALUES('Date Table'[Year])),
    CALCULATE(COUNTA('Sheet1'[Product]))
)
bchager6_1-1715529479142.png

 


 

@bchager6  - Thank you for your response.

Is it possible to get average of distinctcount instead of count?

Try replacing COUNTA with DISTINCTCOUNT

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.