cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Hugo_Gallardo
Helper I
Helper I

Power BI Embedded : Cant doCross Filtering selecting multiple rows on a table visual pressing CTRL

Hello I have the following problem:

 

We have embedded different visuals from a PBIX file onto a asp.net core razor view.

 

We have achieved that when a user clicks on a row in a table visual, detect the item and corssfilter the other embedded visuals as the user clicks.

 

On the Power BI environment you can do the same, but by pressing the CTRL key, you can select multiple rows and then it will filter the whole visuals on that page.

 

As we achieved the crossfiltering selecting just one we thought it would do the same by pressing CTRL, the problem is that PowerBI Embedded  visual is not detecting the CTRL key and it is not actually detecting that we are selecting more than one row and it changes the whole filters to the first selected row.

 

We are detecting via JS the CTRL key

Hugo_Gallardo_0-1645732849614.png

After we click in more than one row or item, the event is lost and we can't get the list that the user was selecting:

 

Hugo_Gallardo_1-1645732908822.png

We have tried the following without results:

 

a)

1. document.addEventListener('keydown', function(event) {
console.log(event.key);
}, false);

 

b)

document.addEventListener('keydown', prueba);

function prueba(e) {
console.log(e.KeyCode);
}

 

c)

Hugo_Gallardo_2-1645733077481.png

$("#Tb3").keypress(function() {
console.log( "Handler for .keypress() called." );
});



d)

 

Hugo_Gallardo_3-1645733146186.png

 

 



e) 

$(document).bind("keyup keydown", function(e){
console.log(e);
});

 

 

Do you have any suggestion to help us achieve our goal? 



 

 

 

 

3 REPLIES 3
abner
New Member

Hi @v-yiruan-msft 

 

I have tried in the following way, as you propose, but without success

 

abner_0-1646171782924.png

 

With the dataSelected event I can't get the Ctrl event

 

abner_1-1646172057109.png

 

 

v-yiruan-msft
Community Support
Community Support

Hi @Hugo_Gallardo ,

Please review the following links, hope they can help you.

codesamples.js 

yingyinr_0-1646033922341.png

dataselection.js

How to handle events

report: models.IReport
 page: models.IPage
 visual: models.IVisual
 filters: IFilter[]
 dataPoints: IIdentityValue[]

Best Regards

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

I have tried in the following way, as you propose, but without success

 

Hugo_Gallardo_0-1648760836199.png

 

 

With the dataSelected event I can't get the Ctrl event

 

Hugo_Gallardo_1-1648760836179.png

 

 

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

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

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.