cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Marco57
Helper II
Helper II

Check if table visual has any column from specific table

Hello,

 

I have a table visual that is showing column fields coming from two tables (A and B) having as relationship:

- One two many

- Both filtering Direction

- Not all data from both tables are having link together 

 

In such configuration, let's say I have fields from table A in my visual table as columns, If I add new fields coming from Table B, it will filter down the displayed data to only intersection data existing in A and B, which is fine.

Thus, the amount of rows being displayed in my table visuals is depending on the columns being added to my visual table fields.

 

My question now is how to calculate this amount of rows in a measure?

 

I am missing a triger with an if condition to know if columns from one of the tables had been added to the table visual or not.

 

ISFILTERED is not working as adding a field value to a table is actually not a direct filter and ISCROSSFILTERED is always TRUE as both tables have cross filtering relationship.

 

I would need a way to check if field or table is added to visual or something that can replicate the filtering behaviour that is happening when the table visual is filtering the displayed rows when columns from both tables are added together.

 

Thanks

Rgds

Marc.

 

2 REPLIES 2
RicoZhou
Community Support
Community Support

Hi @Marco57 

If you want to count rows that table a in table b, try to build measures.

Here I build a sample.

Table A

1.png

Table B:

2.png

Relationship is one to many.

A IN B = 
CALCULATE(COUNTROWS('Table A'),FILTER('Table A','Table A'[Cagetory] IN VALUES('Table B'[Category])))
B IN A = 
CALCULATE(COUNTROWS('Table B'),FILTER('Table B','Table B'[Category] IN VALUES('Table A'[Cagetory])))

Result is as  below.

3.png

Best Regards,

Rico Zhou

 

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

 

amitchandak
Super User
Super User

@Marco57 , Are you looking for base data here - "My question now is how to calculate this amount of rows in a measure?"

 

In that case, you need to create a drill-through report will all row-level columns. Or add index column in Table B and use that in visual

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin

Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!