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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Exclude Slicer when selected - but the column is not used in the table

Hi 

 

I have a requirement, In which I have to use customer name as a slicer which should exclude in the table.

so for eg if i select a customer then the respective product id & product description & Net sales should be excluded.

Anonymous123345_0-1664284479997.png

I have implemented a DAX like this,

 

Exclude_selection =
IF(
SELECTEDVALUE(DimCustomer[CustomerName]) IN ALLSELECTED(Customer[CustomerName]) && COUNTROWS(ALLSELECTED(Customer[CustomerName])) <> COUNTROWS(ALL(Customer[CustomerName])),1,0)

 

and have created a disconnected distinct customer name table and used that as a slicer.

Anonymous123345_2-1664285442374.png

 

But as customer name is not present in the table. it is not getting filtered out.

Relationship for the report is 

Anonymous123345_1-1664284985506.png

relationship:

Dimcustomer has customer ID -> Fact sales Customer ID

Dimproduct Product ID -> Fact Sales Product ID

 

Can Anyone provide with a solution?. 

Thanks & Regards

2 REPLIES 2
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

You can create a filter for the customer table (with no relationship between it and the main table) from a virtual table. Then create the following formula.

Slicer_ = VALUES(DimCustomer[Customer])
slicerCustomer =
VAR slicer_c =
    SELECTEDVALUE ( Slicer_[Customer] )
RETURN
    ( IF ( slicer_c = MAX ( FactSales[Customer] ), 1, 0 ) )

vhenrykmstf_0-1664331502306.pngvhenrykmstf_1-1664331547499.png


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


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

Anonymous
Not applicable

Hi @v-henryk-mstf,

 

Thanks for your reply, however When I add customer name in the table the result is achieved but my based upon my requirement Customer name is not present in the table.  

Anonymous123345_0-1664338352206.png

if we try to filter then then the expected result is not achieved 

for eg,

if i try to filter Mark , then it should exclude MArk and produce product Id & Net Sales Excluding mark 

Anonymous123345_1-1664338639218.png

then the result should be ,

ProductID  NetSales

1                 10

2                  20

3                   60

 

but the result produced is 

Anonymous123345_2-1664338767760.png

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.