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
Anonymous
Not applicable

Display a filtered column based on slicer

Hi guys,

 

I would like to dynamically return a filtered column from a table and display on a table/matrix/card based on a slicer:

 

The following sample data illustrates my issue. I have a table that only contains all the strings for the slicer:

2020-05-25_23h38_50.png

 

I have another table that contains IDs in one column and the same values from the slicer as they apply to the IDs.

2020-05-25_23h39_00.png

 

No, I would like to display the IDs on a matrix (or table or card) filtered for the value that was selected by the slicer. For example, if I select "VW" in the slicer, I would like to display two rows containing 3 in the first and 31 in the second row.

 

All other visuals on the report only one value, therefore similar tasks were I was able to realize with a dynamic measure, as follows:

 

 

 

My Measure = 
SWITCH ( SELECTEDVALUE ( Table1[Column1] ),
 "Value1", SUM( Table2[Column1] ),
 "Value2", SUM( Table2[Column2] ),
 "Value3", SUM( Table2[Column3] )
)

 

 

 

Any suggestions? Thanks a bunch in advance!

 

Best,

Jonas

 

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Anonymous ,

 

If your slicer and salestalk table are related you should use a measure similar to the one below:

 

Active Filter_ = 
Active Filter_ = 
 CALCULATE(
CONCATENATEX (
       DISTINCT(SalesTalks[ID]);
       SalesTalks[ID];
        ","
    ); 
USERELATIONSHIP(Slicer[Slicer Values];SalesTalks[SalesTalks])
)

 

 

Then you can use in a card or similar, you can also change the "," by the separator you prefer.

 

 

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

2 REPLIES 2
MFelix
Super User
Super User

Hi @Anonymous ,

 

If your slicer and salestalk table are related you should use a measure similar to the one below:

 

Active Filter_ = 
Active Filter_ = 
 CALCULATE(
CONCATENATEX (
       DISTINCT(SalesTalks[ID]);
       SalesTalks[ID];
        ","
    ); 
USERELATIONSHIP(Slicer[Slicer Values];SalesTalks[SalesTalks])
)

 

 

Then you can use in a card or similar, you can also change the "," by the separator you prefer.

 

 

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Thanks for the solution! Worked like a charme.

 

Best,

Jonas

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.