Forum Discussion
How do I return grand total in table reference in a measure?
- 4 years ago
Hi that table is an aggregation of counts by month. So it's not a raw table. I am trying to get a average of counts by month.
I was able to get the numerator correct, but the denominator not. Anyway, I found a solution that has worked as below.
AVG Ticket Volume =
VAR AVGIT =
CALCULATE (
AVERAGEX (
ADDCOLUMNS (
SUMMARIZE ( Tickets, 'Tickets'[Module], 'Dates'[MonthYear] ),
"@Count", CALCULATE ( COUNT ( Tickets[No] ) )
),
[@Count]
),
ALLSELECTED ()
)
RETURN
AVGIT
I'm having a hard time seeing why you need such complexity in your measure:
Can you tell me why something simple like ALL(Table) wouldn't work?
Hi that table is an aggregation of counts by month. So it's not a raw table. I am trying to get a average of counts by month.
I was able to get the numerator correct, but the denominator not. Anyway, I found a solution that has worked as below.
AVG Ticket Volume =
VAR AVGIT =
CALCULATE (
AVERAGEX (
ADDCOLUMNS (
SUMMARIZE ( Tickets, 'Tickets'[Module], 'Dates'[MonthYear] ),
"@Count", CALCULATE ( COUNT ( Tickets[No] ) )
),
[@Count]
),
ALLSELECTED ()
)
RETURN
AVGIT