Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
areias_br
Helper I
Helper 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 (

    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] = VALUEOFTHESELECTEDSLICER

    )

)

 

Any way to solve this? Tables are not related. In my mind it should be simple, but I have tried different solutions no results so far.



3 REPLIES 3
Anonymous
Not applicable

Thank you @TomMartens  for your prompt reply.

Hi @areias_br  ,
Depending on the information you have provided, would you be able to provide more data (without private information) so that we can better understand and solve the problem you are experiencing.

 

How to Get Your Question Answered Quickly - Microsoft Fabric Community

If it does not help, please provide more details with your desired out put and pbix file without privacy information.

 

Best Regards,

Ada Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.3

TomMartens
Super User
Super 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



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Hi,

It didn't work 😞

When I click the slicer the values of the graph don't change.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.