Forum Discussion
inner join
Hi,
i need to join 2 tables in order to calculate a meaure in power BI
i have 2 tables A and table B my aim is to add a measure in table A
in sql :
select count(A.ID) from A
inner join B on B.id=A.ID
where B.status='payed'
Thank you in advance
Hi Mariam1991,
Could you try the formula below to see if it works in your scenario? :smileyhappy:
New Column In Table A = COUNTROWS ( FILTER ( RELATEDTABLE ( 'TableB' ), 'TableB'[status] = "payed" ) )
Regards
13 Replies
- vanessafvgCommunity Champion
create a relationship if there isn't already between table table a id to table b id in the relationship view
measurename = calculate(countrows(['table A'), 'Table B'[Status] = "payed")
- Mariam1991Helper II
thanks but i dont need a relation but an inner join between 2 table
more than that i do the same measure and it doesn't work :(
- vanessafvgCommunity Champion
the relationship is an inner join.
- v-ljerr-msftMicrosoft Employee
Hi Mariam1991,
Could you try the formula below to see if it works in your scenario? :smileyhappy:
New Column In Table A = COUNTROWS ( FILTER ( RELATEDTABLE ( 'TableB' ), 'TableB'[status] = "payed" ) )
Regards
- Mariam1991Helper II
hi
thanks a lot , it works correctly but if i need to count just a distinct id
- v-ljerr-msftMicrosoft Employee
Hi Mariam1991,
Could you try the formula below to see if it works? :smileyhappy:
New Column In Table A = COUNTROWS ( FILTER ( RELATEDTABLE ( 'TableB' ), 'TableB'[status] = "payed" && 'tableB'[DATE_str] = 'TableA'[Date] ) )Regards