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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
nemo189
Frequent Visitor

Filtering using slicer dax

I have two disconnected tables table 1 and table 2 . Now I want to create a slicer using table 1(slicer table) column . condition is if nothing is selected then a certain value should be filtered in table 2 . If any other value is selected then corresponding data should be filtered in table 2. Example : if user selects blank in slicer then the table 2 should be default filtered for only D. If user selects any value lets say M, then table 2 should be filtered for M. If user selects ALL , then All the value should be shown . I was thinking on an approach using flag . Not able to achieve. Please help

nemo189_0-1705057953848.png

nemo189_1-1705057994001.png

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @nemo189 

You can refer to the following sample.

Sample table2.

vxinruzhumsft_0-1706685886453.png

Slicer table

vxinruzhumsft_1-1706685903244.png

 

Create a measure

Measure =
IF (
    ISFILTERED ( 'Table'[Column1] ),
    IF (
        SELECTEDVALUE ( 'Table'[Column1] ) = "ALL",
        CALCULATE ( SUM ( Table2[Value] ) ),
        CALCULATE (
            SUM ( Table2[Value] ),
            FILTER ( Table2, Table2[Column1] IN VALUES ( 'Table'[Column1] ) )
        )
    ),
    CALCULATE ( SUM ( Table2[Value] ), FILTER ( Table2, Table2[Column1] = "D" ) )
)

Output

vxinruzhumsft_2-1706685957281.png

 

vxinruzhumsft_3-1706685971549.png

 

vxinruzhumsft_4-1706685981875.png

Best Regards!

Yolo Zhu

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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @nemo189 

You can refer to the following sample.

Sample table2.

vxinruzhumsft_0-1706685886453.png

Slicer table

vxinruzhumsft_1-1706685903244.png

 

Create a measure

Measure =
IF (
    ISFILTERED ( 'Table'[Column1] ),
    IF (
        SELECTEDVALUE ( 'Table'[Column1] ) = "ALL",
        CALCULATE ( SUM ( Table2[Value] ) ),
        CALCULATE (
            SUM ( Table2[Value] ),
            FILTER ( Table2, Table2[Column1] IN VALUES ( 'Table'[Column1] ) )
        )
    ),
    CALCULATE ( SUM ( Table2[Value] ), FILTER ( Table2, Table2[Column1] = "D" ) )
)

Output

vxinruzhumsft_2-1706685957281.png

 

vxinruzhumsft_3-1706685971549.png

 

vxinruzhumsft_4-1706685981875.png

Best Regards!

Yolo Zhu

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

BA_Pete
Super User
Super User

Hi @nemo189 ,

 

Ok, so firstly you don't want/need the blank value in Table2 in order to have an unfiltered state, you can just clear the slicer, so remove this from your Table2 options.

Next, I think the best way to handle your requirements would be via your measure(s), something like this:

_yourMeasure =
IF(
    ISFILTERED(Table2[slicer table column]),
    [your regular calculation here],
    [your "D" calculation here]
)

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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