Help building a virtual column expression?

I have 3 relevant tables:

  • Breweries (key: BreweryID)
  • Beers (key: BeerID)
  • Tastings (key: TastingID)

Breweries are independent entities. Every entry in the Beers list has a BreweryID. Every entry in the Tastings list has a BeerID.

Beers and Breweries have Related virtual columns automatically thanks to the direct reference between the BeerID and the BreweryID. What Iโ€™d like is a Related Tastings at the Brewery level, so when someone is in the Brewery context, they have two Related sections - Related Beers and Related Tastings.

Thanks for any help you can provide!

Solved Solved
0 6 125
1 ACCEPTED SOLUTION

1000%.

I agree with this. I guess I saw you were new to the Community so just assumed you were just beginning the app.


So how to get Related Tastings? If I understand this part of your data structure, Tasting rows are indirectly related to a brewery through Beers. We just need to โ€œconnect the dotsโ€!

An expressionl ike this should do it:

SELECT(Tastings[TastingID], 
                IN([BeerID], 
                      SELECT(Beers[BeerID], [Brewery ID] = [_THISROW].[BreweryID])))

View solution in original post

6 REPLIES 6
Top Labels in this Space