cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Highlighted
Super User
Super User

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
Highlighted
Super User
Super User

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
Super User

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 Established Member
Established Member

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
October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Badges

Incoming: New and Improved Badges

Exciting news: We've given our badges an overhaul and added brand news ones.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 230 members 2,526 guests
Please welcome our newest community members: