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
Jenni3hugs
New Member

Using a Slicer to filter concatenated Column

Hello! I am trying to use a slicer to filter a concatenated column and the measures I have found/edited from this fourm are not working. 

 

Esentially my data looks something like this:

MonthItemScopeTopic
FebReport AEmployees | Students | ProgramsFinances | Human Resources | Enrollment
JulReport BEmployeesHuman Resources
SepReport CStudentsEnrollment
SepReport DProgramsOutcomes
OctReport EStudents | ProgramsEnrollment
OctReport FPrograms | EmployeesFinances

 

I would like to be able to use the slicer to view if the scope contains Students, programs or employees. 

 

I created a new table with just the scope values (Students, Programs, Employees) to use for the Slicer values. (named Scope)

I tried creating the following measures, (individually) but when I use the filter it doesn't show any of the concatenated rows. 

(In example: if I selected "students" on the slicer, only Report C would show. )

 

Measure1 = 

= IF(CONTAINSstring(Distinctcount(Table1[Scope]), "employees"), If(CONTAINSstring(Distinctcount(Table1[Scope]), "Students"), If(CONTAINSstring(Distinctcount(Table1[Scope]), "Programs"), 1, 0) ))
 
Measure 2  = 
 Calculate (Countrows ('Table1'), FILter ('Table1', SUMX ('Scope', Search('Scope'[Scope], 'Table1'[Scope],1,0))>0))
 
Any help on how to edit these measures (or create a new measure) to enable the slicer to work as I would like would be greatly appreciated. 
1 ACCEPTED SOLUTION
v-cgao-msft
Community Support
Community Support

Hi @Jenni3hugs ,

 

We still need a new table for the filter. And don't create relationship with Table1.

vcgaomsft_0-1646984867565.png

vcgaomsft_1-1646984957413.png

Then create a measure and use it on the table visual filter, set the filter to show items when value is 1.

 

Measure = IF(CONTAINSSTRING(MAX('Table1'[Scope]),MAX('Scope'[Scope])),1,0)

 

vcgaomsft_2-1646985178032.png

The result should be like this.

vcgaomsft_3-1646985228077.png

vcgaomsft_4-1646985245026.png

vcgaomsft_5-1646985269574.png

Attach the PBIX file for reference. Hope it helps.

 

If this doesn't work for you, please consider sharing more details about it. And it would be great if there was a sample file without any sensitive information here.

 

It makes it easier to give you a solution.

  1. Sample (dummy dataset) data as text, use the table tool in the editing bar.
  2. Expected output from sample data.
  3. Explanation in words of how to get from 1. to 2.

 

Best Regards,
Community Support Team_Gao

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

View solution in original post

3 REPLIES 3
v-cgao-msft
Community Support
Community Support

Hi @Jenni3hugs ,

 

We still need a new table for the filter. And don't create relationship with Table1.

vcgaomsft_0-1646984867565.png

vcgaomsft_1-1646984957413.png

Then create a measure and use it on the table visual filter, set the filter to show items when value is 1.

 

Measure = IF(CONTAINSSTRING(MAX('Table1'[Scope]),MAX('Scope'[Scope])),1,0)

 

vcgaomsft_2-1646985178032.png

The result should be like this.

vcgaomsft_3-1646985228077.png

vcgaomsft_4-1646985245026.png

vcgaomsft_5-1646985269574.png

Attach the PBIX file for reference. Hope it helps.

 

If this doesn't work for you, please consider sharing more details about it. And it would be great if there was a sample file without any sensitive information here.

 

It makes it easier to give you a solution.

  1. Sample (dummy dataset) data as text, use the table tool in the editing bar.
  2. Expected output from sample data.
  3. Explanation in words of how to get from 1. to 2.

 

Best Regards,
Community Support Team_Gao

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

johnt75
Super User
Super User

I think your best bet would to use Power Query to manipulate the data so that you have one row per combination, so Report A would have rows for Employees / Finances, Employees / Human Resources etc.

Splitting the columns by delimiter and then turning the new columns into rows by pivoting or unpivoting ( I can never remember which is which ) should do the trick.

Hi! Thanks for your reply, but unfortunately with the actual Dataset that would create way too many rows for the final product. (that would be 9 rows for report A alone) Additionally, the format it is in is the format my department wants to use for the final dashboard. That's why I'm hoping to use a measure. 

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.

Top Solution Authors