Forum Discussion

PowerBIMaster97's avatar
PowerBIMaster97
New Member
3 years ago
Solved

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 ...
  • Barthel's avatar
    3 years ago

    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] )
    )