Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
fcanney
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
AlB
Super User
Super User

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
venal
Memorable Member
Memorable Member

@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?

 

AlB
Super User
Super User

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

fcanney
Frequent Visitor

Thank you so much!  That worked beautifully.  Cheers

@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

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.