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
mariajuliao
Frequent Visitor

Monthly Average Distinct Count - Measure

How can I create a measure that calculates the  monthly average of distinct count

CaseNumberCreatedDateComputer
abcde1/2/2023Computer1
abcdf1/3/2023Computer1
abcdg1/4/2023Computer2
abcdh2/14/2023Computer2
abcdi2/17/2023Computer1

 

In this example, for month 1 I have three cases. For month 2 I have two cases. The monthly average is 2.5 cases.

How do I create a measure to calculate this? 

Additionally, how do I create a measure to calculate the average per month, per computer?

2 REPLIES 2
CNENFRNL
Community Champion
Community Champion

CNENFRNL_0-1681462231508.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

FreemanZ
Super User
Super User

hi @mariajuliao 

try like:

Measure =
VAR _table=
ADDCOLUMNS(
     TableName,
     "YYYYMM",
     FORMAT(TableName[CreatedDate], "YYYYMM")
)
RETURN
AVERAGEX(
    SUMMARIZE(_table, [YYYYMM]),
    CACULATE(COUNTROWS(_table))
)

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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