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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
AnthonyJoseph
Resolver III
Resolver III

include filters in allselected function

Hello,

I need to apply the filter (from filter pane) to the allselected function. I am aware that using values function gives the count but I 

need the function to return all the rows in a table, or all the values in a column, based on the filter selection for other calculations/measures.

 

Below is the sample dataset:

YearClientProject

2020A1
2021A2
2022A3
2019B1
2018B2
2020B3
2021B4

 

AnthonyJoseph_0-1687929114309.png

 

is it possible to get return all the rows that are matching only the selected years in slicer (respecting the filters applied).

 

Thanks,

AnthonyJoseph

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @AnthonyJoseph,

I'd like to suggest you use Dax expression to extract the selection and store in variable. Then you can use this as condition in formula calculations:

formula =
VAR selection =
    VALUES ( Table2[Column2] )
RETURN
    CALCULATE (
        COUNTROWS ( ALLSELECTED ( Table1[Column] ) ),
        FILTER ( ALLSELECTED ( Table1 ), [Column2] IN selection )
    )

Regards,

Xiaoxin Sheng

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @AnthonyJoseph,

I'd like to suggest you use Dax expression to extract the selection and store in variable. Then you can use this as condition in formula calculations:

formula =
VAR selection =
    VALUES ( Table2[Column2] )
RETURN
    CALCULATE (
        COUNTROWS ( ALLSELECTED ( Table1[Column] ) ),
        FILTER ( ALLSELECTED ( Table1 ), [Column2] IN selection )
    )

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.