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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
spenceratchison
Regular Visitor

Dax to Ignore Specific Slicer

Hello,

I am attempting to create a measure that is responsive to a specific slicer, but not another. I will include screenshots to illustrate my issue.

spenceratchison_0-1666742326343.png
As you can see, this is functioning properly as the card is displaying the corresponding defensive value in the table for the slicer selection. I will now include a screenshot when a team is selected in the other slicer.

spenceratchison_1-1666742420178.png

The value goes to 0 whenever I select a team from both slicers and I am wanting my calculation to ignore the second slicer. I am aware that I can edit the interactions of the given slicer to have it not impact a specific visual, but I am planning on referencing this measure within other measures, so I can't have this other slicer impacting the value that it calculates. My current measure is 

Test Away Defense = IF(SELECTEDVALUE(Schedule[Away Team])=BLANK(),0,Calculate([Defensive Elo - Away Table],'Away Team Table'[Team] = SELECTEDVALUE('Schedule'[Away Team]),REMOVEFILTERS('Schedule'[Home Team]))). I thought the REMOVEFILTERS function would prevent that slicer from impacting my calculation, but it doesn't seem to be working that way. I appreciate the suggestions in advance!

 

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @spenceratchison ,

 

You will need to use a separate table that doesn't have a relationship (disconnected table) from your fact tables and then create a measure so  it is filtered according to what is selected in the column from that disconnected table.

 

Disconnected Table =
//as a calcualted table
DISTINCT ( 'Table'[Slicer Column] )

 

My Measure =
CALCULATE (
    [My measure],
    FILTER (
        'Table',
        'Table'[Slicer Column] = SELECTEDVALUE ( 'Disconnected Table'[Slicer Column] )
    )
)

OR

My Measure =
CALCULATE (
    [My measure],
    FILTER (
        'Table',
        'Table'[Slicer Column] IN VALUES ( 'Disconnected Table'[Slicer Column] )
    )
)

 

Alternatively,

 

You can still create a relationship between your fact table and that calculated table but keep it INACTIVE. Use USERELATIONSHIP to invoke the relationship between the two

My Measure =
CALCULATE (
    [My measure],
    USERELATIONSHIP ( 'Disconnected Table'[Slicer Column], 'Table'[Slicer Column] )
)

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

3 REPLIES 3
marcopaz
Frequent Visitor

This solution helped me a lot with my problem as well. Thank you so much

danextian
Super User
Super User

Hi @spenceratchison ,

 

You will need to use a separate table that doesn't have a relationship (disconnected table) from your fact tables and then create a measure so  it is filtered according to what is selected in the column from that disconnected table.

 

Disconnected Table =
//as a calcualted table
DISTINCT ( 'Table'[Slicer Column] )

 

My Measure =
CALCULATE (
    [My measure],
    FILTER (
        'Table',
        'Table'[Slicer Column] = SELECTEDVALUE ( 'Disconnected Table'[Slicer Column] )
    )
)

OR

My Measure =
CALCULATE (
    [My measure],
    FILTER (
        'Table',
        'Table'[Slicer Column] IN VALUES ( 'Disconnected Table'[Slicer Column] )
    )
)

 

Alternatively,

 

You can still create a relationship between your fact table and that calculated table but keep it INACTIVE. Use USERELATIONSHIP to invoke the relationship between the two

My Measure =
CALCULATE (
    [My measure],
    USERELATIONSHIP ( 'Disconnected Table'[Slicer Column], 'Table'[Slicer Column] )
)

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Hi @danextian Could you help with this scenario

I need to use finish date and reported date from the same table. create a measure to calculate total orders so that it is not affected by finish date slicer but is affected by reported date. just the reverse for another measure to calculate completed orders(order status =COMP or CLOSE) . should change with finish date slicer  but not with reported date slicer. both these measures have to be used in a column chart to show total orders and completed orders

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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