Forum Discussion
areias_br
2 years agoHelper I
Count Rows Based on Slicer Value
Hi... I need to find out the correct way to complete the formula below based on the input of the user in a slicer that filters a collumn: "Tabela_Ações"[Módulo]. Actions Overdue = COUNTROWS ...
TomMartens
2 years agoSuper User
Hey areias_br,
I recommend this approach:
Actions Overdue =
var valuesfromslicer = values( 'Tabela_Ações'[Módulo] )
return
COUNTROWS (
FILTER (
'Tabela_Ações',
'Tabela_Ações'[Data do Evento] < tb_Acompanhamento_Semanal[Data]
&& 'Tabela_Ações'[Status 90D Criteria] = "Open Overdue"
&& 'Tabela_Ações'[Módulo] IN valuesfromslicer
)
)
If you are using IN instead of = it will become possible to process a multiselection in the measure.
If you do not want use multiselect you can use the below approach, but then you might consider to provide a default value:
Actions Overdue =
var slicervalue = SELECTEDVALUE( 'Tabela_Ações'[Módulo] , "defaultvalue" )
return
COUNTROWS (
FILTER (
'Tabela_Ações',
'Tabela_Ações'[Data do Evento] < tb_Acompanhamento_Semanal[Data]
&& 'Tabela_Ações'[Status 90D Criteria] = "Open Overdue"
&& 'Tabela_Ações'[Módulo] = slicervalue
)
)
Hopefully this provides what you are looking for.
Regards,
Tom
- areias_br2 years agoHelper I
Hi,
It didn't work 😞
When I click the slicer the values of the graph don't change.