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

Multiplying across related tables with a qualifier

Hi - I am fairly new to PowerBI and I'm trying to use a measure to calculate a company's exposure to an underlying investment.  Basically, I'd like to filter for a given company, and have Power BI calculate their exposure to the underlying investments.  Simplistically, there are two related tables that have a Ticker symbol as the common dimension: 

 

Table 1
CompanyTicker% Owned
ACCC10%
ADDD15%
BCCC5%
BDDD10%

 

Table 2
TickerInvestment 1Market
CCC100Atlanta
CCC200DC
CCC300Seattle
DDD100San Francisco
DDD200Chicago
DDD300NYC

 

And I would like to use a filter to select Company A, and I would get back the following information as shown in Table 3:

Table 3
CompanyTickerOwnershipMarketValue
ACCC10%Atlanta10
ACCC10%DC20
ACCC10%Seattle30
ADDD15%San Francisco15
ADDD15%Chicago30
ADDD15%NYC45
   Total150

 

Thank you in advance for any help you can provide!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

Re: Multiplying across related tables with a qualifier

Hi @fcanney 

You could create a new calculated table with all you want and then use a slicer to select the company

1. Create a new table:

NewTable =
ADDCOLUMNS (
    GENERATE (
        Table1;
        CALCULATETABLE (
            SUMMARIZE ( Table2; Table2[Investment 1]; Table2[Market] );
            FILTER (
                ALL ( Table2[Ticker] );
                Table2[Ticker] = CALCULATE ( DISTINCT ( Table1[Ticker] ) )
            )
        )
    );
    "Value"; [Ownership] * [Investment 1]
)

2. Place all the columns you want to see in a table visual. Make sure they are all set to "Don't summarize"

3. Use a slicer on NewTable[Company] to select company as needed

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers  Datanaut

View solution in original post

4 REPLIES 4
Super User III
Super User III

Re: Multiplying across related tables with a qualifier

Hi @fcanney 

You could create a new calculated table with all you want and then use a slicer to select the company

1. Create a new table:

NewTable =
ADDCOLUMNS (
    GENERATE (
        Table1;
        CALCULATETABLE (
            SUMMARIZE ( Table2; Table2[Investment 1]; Table2[Market] );
            FILTER (
                ALL ( Table2[Ticker] );
                Table2[Ticker] = CALCULATE ( DISTINCT ( Table1[Ticker] ) )
            )
        )
    );
    "Value"; [Ownership] * [Investment 1]
)

2. Place all the columns you want to see in a table visual. Make sure they are all set to "Don't summarize"

3. Use a slicer on NewTable[Company] to select company as needed

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers  Datanaut

View solution in original post

Super User III
Super User III

Re: Multiplying across related tables with a qualifier

@fcanney 

See what was described above at work in the attached file.

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers  Datanaut

venal New Contributor
New Contributor

Re: Multiplying across related tables with a qualifier

@fcanney 

 

Please refer the PBIX with out DAX.

 

Multiplying across related tables with a qualifier.JPG

 

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

If this post was helpful may I ask you to mark it as solution and give it some kudos?

 

fcanney Frequent Visitor
Frequent Visitor

Re: Multiplying across related tables with a qualifier

Thank you so much!  That worked beautifully.  Cheers

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

January 2020 Community Highlights

January 2020 Community Highlights

Make sure you didn't miss any of the things that happened in the community in January!

Top Solution Authors