Forum Discussion
Two related tables - hide second table list until primary record selected
I have a page with two tables that are related by a project ID. The first table is the project header information and the second table is a list of notes for related projects (1:N, on to many) relationship. When the page displays it shows ALL records for both lists. What I would like is to suppress the notes until a project is selected from the first table. I would like to do this without using a slicer. What first comes to mind is creating a measure (or table variable) from the selected primary table record. Is there a way to suppress the list of notes and only show the notes of the selected record?
Thanks for the information.
That's indeed a strange behavior. What I tested so far is:
1. if the columns are in the same table the behavior is what you described
2. if you do the suggested solution between two related tables then it works properly (completely hiding table 2 if nothing is selected in table 1)
Try creating a new table, only with the unique ProjectIDs, create a relationship with your Table1, create the Selected measure based on the new table and do the the rest.
4 Replies
- MNedixSolution Sage
Heya,
I may misunderstand your scenario but I'm thinking a measure based on Table 1 which you can use as a filter (in the Filter Panel) for Table 2.
The measure would be somethign like:
Selected = IF(NOT ISBLANK(SELECTEDVALUE('Table1'[ProjectID])),1,0)You then put this measure as a filter in Filter panel for table 2 and set it to show when 1 (see below):
Hope it helps.
- guyatiskHelper II
Thank you!!! I originally put the measure in the first table and moved it into the second (not sure if that mattered) and made sure my syntax was correct. But now it is working as expected. Have a great day!
- guyatiskHelper II
This did put me in a good direction, but is there a way to NOT list ALL the comments in the second table when there is NOTHING selected in the first table? When the report is first opened, there is nothing selected in the primary table and it shows all comments made in the second table, which is confusing.
- MNedixSolution Sage
That's indeed a strange behavior. What I tested so far is:
1. if the columns are in the same table the behavior is what you described
2. if you do the suggested solution between two related tables then it works properly (completely hiding table 2 if nothing is selected in table 1)
Try creating a new table, only with the unique ProjectIDs, create a relationship with your Table1, create the Selected measure based on the new table and do the the rest.