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

Need help with measures combining two tables

Hello Team,

 

Need some help, I've been trying to sort this out using different combinations of DAX Formulas and I'm still missing a couple of what should be simple measures but for some reason it has been a nightmare on the way is interacting with the rest of the things.

 

Long story short (trying to simplify the Business Case)

1. Have 2 Tables (Table 1 with Sales Details and Table 2 with Hierarchy Account List)
    1.1. We may have Accounts from Table 2 (universe of accounts) that have no Sales in Table 1

 

2. You can have in the raw data (Table 1) something like this (obviously with a ton of more details):

TABLE 1.PNG

 

3. There is a second table with Account "Universe"

TABLE 2.PNG

 

4. We should be able to get the following measures (some examples):

TABLE 3.PNG

 

Need your help to try to get the last 2 measures:

A. Accounts with Product A ONLY and

B. % Accounts with Product A Only vs Table 2 (Account Universe)

 

Note: Measures should interact based on selected filtered criteria and be able to visualize in Matrix or Charts

 

I know is very simple, but there is something that I'm missing reason why I would like to start from scratch with your inputs. Any help is more than welcome!


Thanks,

Mario

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

Re: Need help with measures combining two tables

@malguera

 

May be you can add another FILTER expression inside CALCULATE

 

Accounts with Product A only =
CALCULATE (
    DISTINCTCOUNT ( Table1[Account] ),
    FILTER (
        ALLSELECTED ( Table1[Account] ),
        CALCULATE ( DISTINCTCOUNT ( Table1[Product] ) = 1 )
    ),
    Table1[Product] = "A"
)
Try my new Power BI game Cross the River

View solution in original post

2 REPLIES 2
Super User III
Super User III

Re: Need help with measures combining two tables

@malguera

 

May be you can add another FILTER expression inside CALCULATE

 

Accounts with Product A only =
CALCULATE (
    DISTINCTCOUNT ( Table1[Account] ),
    FILTER (
        ALLSELECTED ( Table1[Account] ),
        CALCULATE ( DISTINCTCOUNT ( Table1[Product] ) = 1 )
    ),
    Table1[Product] = "A"
)
Try my new Power BI game Cross the River

View solution in original post

malguera Frequent Visitor
Frequent Visitor

Re: Need help with measures combining two tables

Thanks Zubair! Seems is working fine, I'll finalize the Dashboard to see how the measure interacts with the rest of calculations.
Very much appreciated!

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.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors