Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Create a monthly graph containing dynamical values

Hello everybody,

I discovered PowerBI few hours ago and I am trying to render a new graph, pretty complex from my data.

My subject:

I have a list of employees from my society with some information (name, location, seniority, ....) inside a table named Suivis de mission. I'm focusing on seniority column. I have to display, monthly, the number of employees which has less than 3 seniority years, more than 3, more than 5 and more than 8.

This field is calculed through another field (date_de_changement_de_mission) by the next formula:

(today - date de chagement de mission) / 365

It gives me a number according to the seniority years (above in french)

enter image description here

 

My experimental work:

I tried to make some things and this is what I have up to now.

I created a new table with months (string column1 and int column2) and the third column according to the number of employee with less than 3 seniority years for each month.

 

enter image description here

 

This is the formula that I'm trying to implement in order to get the number but I have lot of mistakes :

Nbr_inf_3_ans = SUMX('Suivis de mission';
                    IF(
                        'Suivis de mission'[Activité] = "En poste";1 && 
                        DIVIDE(
                            DATEDIFF(01/01/2019;'Suivis de mission'[Date de changement de mission].[Date];DAY);365)
                            ;"null"))

The formula must contains several conditions :

  • Field 'Suivis de mission'[Activité] has to be : "En poste"
  • Loop over each month in my table (if the month is not targed, display 0)

I'm a bit lost.

2 Replies