Reference to Table Rows from Many-to-Many relation

I have a Many-to-Many bridge table where I set the FK columns to Ref, which in turn automatically created a de-reference in each of my tables. This displays like this:
2X_d_d42c21ae300683800ab85246c6fd05fc59dad1bd.png

Ideally what I would like is rather than displaying the table with the two columns I would only like to display a table of the records on the โ€˜Annual Reportsโ€™ side. I attempted this by creating another virtual column in my Permits table with a formula of FILTER(โ€œAnnualPermitDataโ€,IN([id],[Annual Reports])). Unfortunately this did not return any records. My question is how I need to fix my formula and/or is there a more efficient way to accomplish this (something that would be less intensive from a query perspective)?

0 4 811
4 REPLIES 4

Steve
Platinum 4
Platinum 4

Try:

SELECT(
  AnnualPermitData[Annual Reports],
  IN([_THISROW], [Related Permits]),
  TRUE
)

Iโ€™m curious why a permit references the permit data rather than the other way around. If the other way around, you could just use:

[Related AnnualPermitDatas][Annual Reports]

See also:



I get this now
2X_0_0e7350074edc14e2e9ad7f68c5de952816b502f9.png

The virtual column of โ€˜Annual Reportsโ€™ is contained in my PermitList table and has formula
2X_1_11548f44e0257124c80de937fa93d5764e9bc930.png

The virtual column of โ€˜Related Permitsโ€™ is contained in my AnnualPermitData table and has a formula
2X_2_2b47361185e39a20737f7cada44de5963586e43e.png

And these are the columns in the bridge table i.e. table AnnualPermitDataPermits_Has_RelatedPermits
2X_f_fe526eec842e54467dab22cfa80b0e4c24f3f9c9.png

Hopefully that clears up some of the data structure and you see something.

Try:

SELECT(
  AnnualPermitDataPermits_Has_RelatedPermits[AnnualPermitDataPermits_fk],
  ([_THISROW] = [RelatedPermits_fk]),
  TRUE
)

Hi Steve,

Thank you that certainly helped it along. This is what I ended up needing to do to give me the desired result:
FILTER(โ€œAnnualPermitDataโ€,
IN([id],
SELECT(
AnnualPermitDataPermits_Has_RelatedPermits[AnnualPermitDataPermits_fk],
([_THISROW] = [RelatedPermits_fk]),
TRUE
)
)
)

2X_5_5db811c30abe4ed76d7e10283def4a93b0693d5b.png
So the top portion is what I was getting before, but the bottom is what I actually wanted.

As a follow up though, is there a more efficient expression that I could use to get the same accomplished? I am looking at this from a resource (time intensive) perspective.

Top Labels in this Space