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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Arioli_Chezhian
Helper II
Helper II

How to identify average when the column has text datatype?

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
Anonymous
Not applicable

Hi @Arioli_Chezhian ,
Here some steps that I want to share, you can check them if they suitable for your requirement.
Here is my test data:

vheqmsft_0-1715580819298.png

Create a measure

Distintcount = 
VAR _a = 
CALCULATE(
    DISTINCTCOUNT('Table'[Username]),
    ALL('Table')
)
RETURN
CALCULATE(
    COUNT('Table'[Username])/_a
)

Final output

vheqmsft_1-1715580857367.png

 

Best regards,
Albert He

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

 

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Arioli_Chezhian ,
Here some steps that I want to share, you can check them if they suitable for your requirement.
Here is my test data:

vheqmsft_0-1715580819298.png

Create a measure

Distintcount = 
VAR _a = 
CALCULATE(
    DISTINCTCOUNT('Table'[Username]),
    ALL('Table')
)
RETURN
CALCULATE(
    COUNT('Table'[Username])/_a
)

Final output

vheqmsft_1-1715580857367.png

 

Best regards,
Albert He

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

 

 

Pawasthi3292
Frequent Visitor

'Average of number of users'
Please elaborate, as in ,what should be output in case of your given scenario.

@Pawasthi3292  - As like average of distinctcount of number of users

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.