Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
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 A | Column B |
Group 1 | Set 1 |
Group 1 | Set 1 |
Group 1 | Set 2 |
Group 2 | Set 3 |
Group 2 | Set 3 |
Group 3 | Set 4 |
Group 1 | Set 5 |
Group 1 | Set 5 |
Group 2 | Set 6 |
I would expect to see this result:
Column A | Avg Count |
Group 1 | 1.666 |
Group 2 | 1.5 |
Group 3 | 1 |
Solved! Go to Solution.
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])
Hi,
Please check the below picture and the attached pbix file.
Expected result: =
DIVIDE ( COUNTROWS ( Data ), COUNTROWS ( DISTINCT ( Data[Column B] ) ) )
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])
User | Count |
---|---|
12 | |
12 | |
8 | |
8 | |
6 |
User | Count |
---|---|
27 | |
19 | |
14 | |
11 | |
7 |