Forum Discussion
How do I write a Dax statement that returns the current counts whenever I filter for a TEam
- 2 years ago
Solution. Thank you all.
CurrentCountPerTeam =
VAR __CurrentYearMonth = DATE(YEAR(TODAY()), MONTH(TODAY()), 1)
RETURN
SUMX(
FILTER(
'Query1',
'Query1'[cyearmonth] = __CurrentYearMonth
),
'Query1'[active_cnt]
)
Try this to see how it is.
RecuentoActualPorEquipo =
CALCULATE(
SUM('Consulta1'[active_cnt]),
FILTER(
'Consulta1',
'Consulta1'[Equipo] = "a" || 'Consulta1'[Equipo] = "b"
),
LASTNONBLANK('Consulta1'[aƱomes], 1)
)
- pacomase12 years agoFrequent Visitor
CurrentCountPerTeam =
SUM('Query1'[active_cnt]),
FILTER(
'Query1',
'Query1'[team] = "a" || 'Query1'[team ] = "b"
),
LASTNONBLANK('Query1'[yearmonth], 1)
)- SammuelM2 years ago
Helper I
Thank you. But I have multiples teams(roughly 40). How do I account for all 40 instead of just 'a' & 'b'. The data you in my original post was just a sample
- SammuelM2 years ago
Helper I
Solution. Thank you all.
CurrentCountPerTeam =
VAR __CurrentYearMonth = DATE(YEAR(TODAY()), MONTH(TODAY()), 1)
RETURN
SUMX(
FILTER(
'Query1',
'Query1'[cyearmonth] = __CurrentYearMonth
),
'Query1'[active_cnt]
)