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
treyd
New Member

Creatiing a new measure

Hi, I need help creating a new measure and have searched but can't find the answer.  I'm trying to do a count of the rows and return the average by each group.

 

For example, given this data set:

Column AColumn B
Group 1Set 1
Group 1Set 1
Group 1Set 2
Group 2Set 3
Group 2Set 3
Group 3Set 4
Group 1Set 5
Group 1Set 5
Group 2Set 6

 

I would expect to see this result:

Column AAvg Count
Group 11.666
Group 21.5
Group 31
1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

hi @treyd ,

 

Try to plot a table measure with ColumnA and a measure like:

AvgCount = 
VAR _table =
ADDCOLUMNS(
    VALUES(data[ColumnB]),
    "Count",
    CALCULATE(COUNTROWS(data))
)
RETURN
AVERAGEX(_table, [Count])

 

FreemanZ_1-1699321888993.png

 

View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1699327746205.png

 

Expected result: =
DIVIDE ( COUNTROWS ( Data ), COUNTROWS ( DISTINCT ( Data[Column B] ) ) )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
FreemanZ
Super User
Super User

hi @treyd ,

 

Try to plot a table measure with ColumnA and a measure like:

AvgCount = 
VAR _table =
ADDCOLUMNS(
    VALUES(data[ColumnB]),
    "Count",
    CALCULATE(COUNTROWS(data))
)
RETURN
AVERAGEX(_table, [Count])

 

FreemanZ_1-1699321888993.png

 

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.