Forum Discussion
PatrickByGecko
Helper V
6 years agoCreating a new table from 2 others with a calculation
Hello I want to create a new table from two others. I have one table of DATES with one column Dates (from 1/1/2019 to 31/12/2050 for instance) and an other one with WORKERS information (Name, Sex, ...
- Anonymous6 years ago
PatrickByGecko - You could create the following Calculated Table in DAX:
New = ADDCOLUMNS(Dates, "Nbr Male", COUNTROWS( FILTER( ALL(Workers), Workers[DateEntry] <= Dates[Date] && Workers[Sex] = "male" ) ), "Nbr Female", COUNTROWS( FILTER( ALL(Workers), Workers[DateEntry] <= Dates[Date] && Workers[Sex] = "female" ) ) )
PatrickByGecko
Helper V
6 years agoOf course. I did an extract and the effect is the same.
Here it is => https://we.tl/t-9QoLPrU5KF
Anonymous
6 years agoNot applicable
PatrickByGecko - The problem is the column [DATE ENTREEE] contains Date + Time information. Therefore, it does not contain exact matches with the date table, which is Date only.
You could create a new column like this:
Date2 = INT(Collaborateurs2[DATE ENTREEE])
Then use the new column in the Relationship and in the DAX, instead of [DATE ENTREEE]
I hope this helps. If it does, please Mark as a solution.
I also appreciate Kudos.
I also appreciate Kudos.
- PatrickByGecko6 years ago
Helper V
It is working Thanks a lot Natel.
Patrick.