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
paul-maessen
Resolver I
Resolver I

Limit the SelectionId for a table view data-mapping to just one column instead of a row.

Hi,

 

I am developing a Custom Visual using a table view datamapping. When selecting one row of the table my current visual now selects the whole row because I have created the selectionId's using the following code:

 

 

 

 

 

 

 

 

        const selection: ISelectionId = this.host.createSelectionIdBuilder()
            .withTable(dataView.table, rowIndex)
            .createSelectionId();

 

 

 

 

 

 

 

 

This also means that other visuals are filtered based on the values of each column in the selected row.  

However I would like to set the selectionId only for one of the columns in the row and not the complete row.

 

For example: Imagine my table -data looks like the table below.

Value AValue BValue C
A1B1C1
A1B2C2

 

When I select the first row the other visuals in my report are now filtered on Value A = A1, Value B = B1 and Value C = C1

I just would like that the filter for the other visuals is only set on Value A = A1 and not on the other values even if they are part of the other visuals data,  so for the other visuals it would not make a different when I select the first or the second row from the table above.

 

I hope my question is clear and that someone can help me solving this issue.

 

Thanks in advance

 

Regards

 

Paul

 

 

1 ACCEPTED SOLUTION
dm-p
Super User
Super User

Hi

The table data view mapping is not designed for such granular use and as such, is one of the limitations of using it. I'm running into similar challenges with a  visual I'm working on.

You get the same results with selections if you use a core table visual and as such I always 'audition' my datasets in a table visual first if I'm planning to use the table data view mapping, in order to make sure this limitation is workable for me. If you want to filter by a particular data role then you would need to use the categorical data view mapping.

If you absolutely have to use the table data view mapping, the only way I'm aware of to make this work - and it's hacky -is to:

  • Isolate the value of the category you want to filter on
  • Filter your dataset for all rows matching this value
  • Add these selection IDs to an array
  • Apply this array to the selection manager rather than a single ID

Please note however, that this is not perfect, as the selection IDs will still contain a tuple of all colums and measures that are in each row and the selection manager will still apply this to other visuals.

Regards,

Daniel





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

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




View solution in original post

2 REPLIES 2
dm-p
Super User
Super User

Hi

The table data view mapping is not designed for such granular use and as such, is one of the limitations of using it. I'm running into similar challenges with a  visual I'm working on.

You get the same results with selections if you use a core table visual and as such I always 'audition' my datasets in a table visual first if I'm planning to use the table data view mapping, in order to make sure this limitation is workable for me. If you want to filter by a particular data role then you would need to use the categorical data view mapping.

If you absolutely have to use the table data view mapping, the only way I'm aware of to make this work - and it's hacky -is to:

  • Isolate the value of the category you want to filter on
  • Filter your dataset for all rows matching this value
  • Add these selection IDs to an array
  • Apply this array to the selection manager rather than a single ID

Please note however, that this is not perfect, as the selection IDs will still contain a tuple of all colums and measures that are in each row and the selection manager will still apply this to other visuals.

Regards,

Daniel





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

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




Hi @dm-p ,

Unfortunately your "trick" will not work for me. 

My goal is not to filter both rows but just not to filter on Value B and Value C.

But thanks for your answer.

 

Regards

Paul

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.