Forum Discussion

dvn_charles's avatar
dvn_charles
Frequent Visitor
4 years ago
Solved

Using the TREATAS() function is it possible enforce an inner join

Hi Guys 

 

Using the TREATAS() function is it possible enforce an inner join

In other words only return records where there is a match?

   TREATAS(VALUES('TableA'[id] ), 'TableB[id]) 

 

TableA has more id's then TableB

Below left is TREATAS and Right is USERELATIONSHIP

I would like them to handle blanks in the same way.

 

 

Kind Regards

Devon

3 Replies

  • dvn_charles , Try a measure like

     

    calculate([meausre], filter(TableB,  'TableB[id] in values('TableA'[id] ) ) )

  • dvn_charles's avatar
    dvn_charles
    Frequent Visitor

    Hi amitchandak 

     

    Thank you kindly for your reply.

    This will work even if TableB and TableA have no active or inactive relationship?

     

    Kind regards

    Devon

  • v-jingzhang's avatar
    v-jingzhang
    Community Support

    Hi dvn_charles 

     

    You could refer to this blog. It should be helpful.

    Building a Virtual Relationship in Power BI - Basics of TREATAS DAX Function - RADACAD

     

    As you said "I would like them to handle blanks in the same way." Which table/column has blank values? How do you want to deal with these blank values? Can you provide some sample data and expected result to help us understand it further?

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.