Quantcast
Channel: Desktop topics
Viewing all articles
Browse latest Browse all 216485

Count in two related tables

$
0
0

Hi I'm new here and I don't know if this is the place to this issue. If not let me know it and i will change it from here.

 

The fact is that I have 2 related tables. In one i have an id and in the other the reference of that id.

 

They are similar to these 2 (I can't show the real ones because of privacity issues. I hope these 2 will be ok to explain myself):

Captura.PNG

 

I need to add a column to table1 with the count of the number of tasks that each id has.

 

I have the following dax fórmula but it returns the count of all the tasks of the table 2 at each row of table 1. That is for this example 4 in all the rows of the new column in table 1. And I want the values 3,1...

 

totalTareas = COUNTAX(FILTER(table2;RELATED(table1[ID]) = table2[Id_del_proceso]);table2[TASK])

 

where id_del_proceso is table1_id in this example

 

I'm new with dax functions and I don't know how to solve it, neither why I obtain that result, but this in sql would be something like a join between the 2 tables and a count of the task grouped by the table1_id.

 

Please clould you explain me what I'm doing wrong and how could i solve this ?

 

Thanks for the help


Viewing all articles
Browse latest Browse all 216485

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>