Forum Discussion

magcl's avatar
magcl
New Member
3 years ago
Solved

compare values from a matrix

Hello everyone,

 

My question is rather basic for those who master Power BI (this is not my case yet 😞) :


I have a simplified dataset with a number of an agent and a date on wich a certain task was performed :

 

agentdatenum_taches
Ag105/01/20231
Ag117/01/20231
Ag107/02/20231
Ag203/01/20231
Ag219/01/20231
Ag219/02/20231
Ag319/01/20231
Ag105/03/20231
Ag219/03/20231
Ag308/03/20231

 


I also have a table of dates to facilitate the management of dates:

 

dateanneemoisjournom_jour_semainenom_moisno_semnom_no_semaineno_trimestrenom_no_trimestreweekend
01/01/2023 00:00202311DimancheJanvier1S11T11
02/01/2023 00:00202312LundiJanvier1S11T10
03/01/2023 00:00202313MardiJanvier1S11T10
04/01/2023 00:00202314MercrediJanvier1S11T10
05/01/2023 00:00202315JeudiJanvier1S11T10
06/01/2023 00:00202316VendrediJanvier1S11T10
07/01/2023 00:00202317SamediJanvier1S11T11
... etc         1

 

-There is a relationship between two tables with the 'date' field-

I need to check if each agent performs a task at least once a month. This means that in March an agent must reach the accumulation of 3 tasks not to be 'late'.

 

So far I managed to create a sum of the tasks :

sum_tache = sum('my_table'[num_taches]

 

... and then make the cumulation :

cum_tache = CALCULATE('my_table'[sum_tache], DATESYTD(('my_calendar'[date])))
 
...which gives the following result on the visual matrix:
 
Q1: I would like the date to be displayed in month format, but when I choose the 'month' field from my 'date' table, the cumulation of values does not work.
 
Last problem: I need my matrix to display in a binary way if the cumulation for a given month is equal to the month, e.g. for ag_3
For January: he performed 1 tasks so we display "1"
For February: its cumulation is equal always at 1 so we display "0"
For March: it has performed 1 task - its cumulation is at 2 - so we display "0" (it should be at 3)
 

Q2 : So my question is - is it possible to compare the cumulative values with an int value that represents the month concerned?

 

Thank you in advance for your help.

Best regards,

 

Mag Cle

 

 

2 Replies