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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Calculate the average of a distinct count measure

Hi,

Can someone please help me with the syntax to find the average of a measure using DISTINCTCOUNT. Here is the syntax of my measure:

Number of Units = DISTINCTCOUNT( LoggedInData[Unit_ID] )

I was hoping I could just do something like this: Avg Number of Units = AVERAGE(DISTINCTCOUNT(LoggedInData[Unit_ID])) but that doesn't work as I am not able to reference my measure.

My Number of Units measure counts the number of times a unique Unit_ID appears in my LoggedInData table.

Thanks!

6 REPLIES 6
Anonymous
Not applicable

Hi @Anonymous,

 

For this scenario, I'd like to suggest create a variable summarize table with filter and add distinct count as a new column to summarize table. Then you can simply calculate average result based on summarize variable.

 

If you confused on coding formula, please share some sample data. (upload a pbix file or excel file with sample data to onedrive or google drive, we can down these files to test)

 

Regards,

Xiaoxin Sheng

LivioLanzo
Solution Sage
Solution Sage

Hi @Anonymous

 

what is the basis for the average calculation? monthly? yearly? 

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

Anonymous
Not applicable

Here is a screenshot of what my matrix looks like.  It is by 15 minute interval.  Where the values are now those are the distinct counts but I need them to be averages.

 

Untitled.jpg

 

 

Average of what Exactly? Because I assume you do not want to average an ID?

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

Anonymous
Not applicable

I need the average number of units (vehicles) that were logged on.  I need to take my count of the number of units (vehicles) that were logged on and apply an average calculation to it.

 

hi @Anonymous

 

Lets say you are counting the number of vehicles on a Monday between 5 p.m and 5:15 pm

The number of vehicles is 100.  If you have just one number then the average of 100 is 100, unless you are counting the number of active vehicles at 5:00 pm, at 5:05 pm and at 5:10 pm and then calculating the average between 5 and 5:15

 

Anyway, perhaps if you share your data it will be easier to see what you are after!

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors