cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ChainSpart
Frequent Visitor

Help filter and results

Hello there,

 

I'll start by saying that I'm totally new with PowerBI, so I apologize if the answer has already been posted, I couldn't find it.

 

So here it is :

 

My data source is a database with multiple tables and views. Here I wanna work only with my views, and I can't alter this database.

 

I have a view A where I only need 1 column that'll give me a list of names (A, B, C, ...). Column colNAME1.

 

I have a view B that can show rows only if I have at least a WHERE clause with one of these names selected.

view B is like   ColNAME2, ColValue, ColDateTime

multiple rows will have colName2 since it has a lot of values

 

So It's like : 

SELECT * FROM dbo.MyViewB WHERE  colNAME2= '(value from colNAME1)'

 

Now I want to translate it in Power BI.

So I've added a Slicer, with my names data on it. I've configured it as a dropdownlist where I can select only 1 name.

I've added a table connected to my second view.

But I don't know how to link them... I though it'd be automatic since when I am on my table, the filter button on top shows that the name selected in the slicer is applied, but I still get an error and no data are shown.

 

Anyone can help please ?  

 

Thanks

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@ChainSpart , You have do this for each measure, you need

 

calculate(sum(MyviewB[Value]), filter(MyviewB, MyviewB[colNAME2] in values(MyviewA[colNAME1])))



Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Learn Power BI P&L Statement || Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s ||
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!!! How to get Quick Help !!
Resources | Master Power BI !! Expertise Power BI !! Power BI For Tableau User !!

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@ChainSpart , You have do this for each measure, you need

 

calculate(sum(MyviewB[Value]), filter(MyviewB, MyviewB[colNAME2] in values(MyviewA[colNAME1])))



Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Learn Power BI P&L Statement || Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s ||
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!!! How to get Quick Help !!
Resources | Master Power BI !! Expertise Power BI !! Power BI For Tableau User !!

Helpful resources

Announcements
November 2022 Update

Check it Out!

Click here to read more about the November 2022 updates!

Microsoft 365 Conference â__ December 6-8, 2022

Microsoft 365 Conference - 06-08 December

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.