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
min-E
Helper I
Helper I

Average of Distinct Count, showing result in Total column only

Hello Community,

 

Two Part Question.

1) I am using the built in feature Count (distinct) of xid to populate the matrix below.

I would like to include the Average of Count (distinct) in the matrix.

The built-in average won't work in this case, since this isn't a number. 

PBI 1.png

 

2) Would it be possible to only show the Average of Count in the total columns? Don't think so, but perhaps someone knows for sure.

 

Link to a test copy.

Test Count and Average Count.pbix 

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @min-E ,

For your first question, we can utilize MEASURE when the built-in COUNT does not apply.

If you want to make it possible to calculate the average in the total column, we need the help of two more measures.

DistinctCountMeasure = DISTINCTCOUNT(Sheet1[xid])

Once you have done this, you can see the average in the total column.

AverageDistinCount = AVERAGEX(VALUES(Sheet1[Region]),CALCULATE('Sheet1'[DistinctCountMeasure]) )
Display = IF(ISINSCOPE(Sheet1[Region]),[DistinctCountMeasure],[AverageDistinCount]) 

vxingshenmsft_0-1721714296143.png

Hope it helps!

Best regards,
Community Support Team_ Tom Shen

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

Anonymous
Not applicable

Hi @min-E ,

I'm glad that my MEASURE helped you to solve part of your problem, seeing that your current requirement is that you want to average the Count of xid based on the date,

then you can try to use the following scenario, hopefully it will solve your problem.

Measure = 
VAR a = MAX(Sheet1[date])
VAR b = MIN(Sheet1[date])
VAR c = DATEDIFF(b,a,MONTH) + 1
RETURN
[DistinctCountMeasure]/c

vxingshenmsft_0-1721806736117.png

Hope it helps!

 

Best regards,
Community Support Team_ Tom Shen

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 @min-E ,

For your first question, we can utilize MEASURE when the built-in COUNT does not apply.

If you want to make it possible to calculate the average in the total column, we need the help of two more measures.

DistinctCountMeasure = DISTINCTCOUNT(Sheet1[xid])

Once you have done this, you can see the average in the total column.

AverageDistinCount = AVERAGEX(VALUES(Sheet1[Region]),CALCULATE('Sheet1'[DistinctCountMeasure]) )
Display = IF(ISINSCOPE(Sheet1[Region]),[DistinctCountMeasure],[AverageDistinCount]) 

vxingshenmsft_0-1721714296143.png

Hope it helps!

Best regards,
Community Support Team_ Tom Shen

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

 

Hello! Thank you for taking the time to reply. It looks like the Display measure is showing the Count.

Maybe I am misunderstanding how that measure works.

Filtering down to 2 months below, as an example:

The Count of 43 is correct.

The Average should be 21.5 (43/2)

 

Test Count and Average Count.png

Anonymous
Not applicable

Hi @min-E ,

I'm glad that my MEASURE helped you to solve part of your problem, seeing that your current requirement is that you want to average the Count of xid based on the date,

then you can try to use the following scenario, hopefully it will solve your problem.

Measure = 
VAR a = MAX(Sheet1[date])
VAR b = MIN(Sheet1[date])
VAR c = DATEDIFF(b,a,MONTH) + 1
RETURN
[DistinctCountMeasure]/c

vxingshenmsft_0-1721806736117.png

Hope it helps!

 

Best regards,
Community Support Team_ Tom Shen

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

 

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