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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
BI_Analyticz
Helper V
Helper V

Average using text column

Hi I have 2 columns date and ticket number. Date column is in datetime format and ticket number is a text column since the ticket numbers are like AB123, AB345, etc.,

 

I want to show the count of tickets every year or month or date in a drill down graph which is very much possible.. But how to show the average for a year or month or individual dates in the drill down graph. Since the ticket number field is a text I dont know how to proceed.

 

DATE          Ticket Number

1-1-2018     AB123

1-1-2018     AB124

1-1-2018     AB174

2-1-2018     AB123

2-1-2018     AB123

.

.

1-10-2020       AB1211

17-10-2020     AB12334

17-1-2020       AB123666

.

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@BI_Analyticz ,

For Average, you need to count till some place. Like count till date and then take daily average for month year

averageX(values(Table[date]), calculate(count(Table[Ticket Number])))

In case you have month and year in a date table
averageX(values(date[date]), calculate(count(Table[Ticket Number])))

 

or Avg of month till year(Sum till month)

averageX(values(date[Month Year]), calculate(count(Table[Ticket Number])))

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

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi  @BI_Analyticz  ,

show the count of tickets every year or month or date in a drill down graph

You can use the matrix to place the date column in rows and the ticket number in values

Result:

v-yangliu-msft_0-1607418344773.jpeg

For text calculation: AVG cannot be performed on text. You can try to count the 'table' [ticket number] first, and then perform an AVG

 

Best Regards,

Liu Yang

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

@BI_Analyticz ,

For Average, you need to count till some place. Like count till date and then take daily average for month year

averageX(values(Table[date]), calculate(count(Table[Ticket Number])))

In case you have month and year in a date table
averageX(values(date[date]), calculate(count(Table[Ticket Number])))

 

or Avg of month till year(Sum till month)

averageX(values(date[Month Year]), calculate(count(Table[Ticket Number])))

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

Hi Amit, do you mind explaining how the suggested measure works? I have a similar issue on my end where I'm trying to find the average number of occurences in a text column. I belive your posted solution will work for my case scenario, but I don't fully understand the logic.

 

Why do you have to include a date column?

 

Thank you! 

Thanks Amit worked like a charm !

BI_Analyticz
Helper V
Helper V

@amitchandak @mahoneypat 

any ideas pls

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.