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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

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

4 REPLIES 4
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.

Apologies to necro-threadjack - but I struggle with this option all of the time. I have datasets where numerous columns might be concatenated (label1;label2;label3) and I often need to develop analysis on the individual members of a concanentation and even as a funciton of another concatenated column (tag1;tag2;tag3). I.e., the unique combinations of of two columns. What I've been doing is as you suggested, creating a reference query off the main and splitting the reference by all of the fields I need to unroll label x tag as an example. And then I use those to display static calculations, percentages, totals etc on a summary page.

 

But I always struggle with - how do I give the user the ability to filter on one of those into the NON concatenated data source. I.e., how can I pass a TAG from the unconcatenated/expanded table into the original concatenated table so I can filter that table?

 

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
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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