cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PowerBIMaster97
New Member

Need help with using columns in two tables without inner joining them

Hello Everyone,

 

The issue I'm currently facing is: I need to use columns that exist in both tables (they have a matching ID column) in order to create some measures and a view. However, the rows in these tables are ALOT and when I tried to join them into one table that has all the columns I need, the processing is much too long.

 

Suppose I have two tables, A and B, and table A has colums of people's ids and their dates of registration, and table B has columns of people's ids and their status.

 

Table A
ID
Date

 

Table B

ID

Status

 

I want to be able to create a measure that can filter the ID's of people with a certain status for a given date. For example, A measure that shows All the IDs that have a status of "Away" for today. Basically, how can I filter columns in both of these tables using one measure without inner joining the tables?

 

Thanks in advance.

1 ACCEPTED SOLUTION
Barthel
Solution Sage
Solution Sage

@PowerBIMaster97 

You could use a virtual relationship in your measure using the TREATAS function. The TREATAS function is processed in the filter part of the CALCULATE function. For example, you can count the number of people based on Table A, taking into account the filters from Table B:

Number of people =
CALCULATE (
    DISTINCTCOUNT ( 'Table A'[ID] ),
    TREATAS ( VALUES ( 'Table B'[ID] ), 'Table A'[ID] )
)

 

View solution in original post

1 REPLY 1
Barthel
Solution Sage
Solution Sage

@PowerBIMaster97 

You could use a virtual relationship in your measure using the TREATAS function. The TREATAS function is processed in the filter part of the CALCULATE function. For example, you can count the number of people based on Table A, taking into account the filters from Table B:

Number of people =
CALCULATE (
    DISTINCTCOUNT ( 'Table A'[ID] ),
    TREATAS ( VALUES ( 'Table B'[ID] ), 'Table A'[ID] )
)

 

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors