Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

COUNTIFS occurrence sensor values DAX

Good morning all,

My request concerns the programming of a measure. As you can see on the image below : 

I have a table with 3 columns: DT10 min (Time of reading the value of the sensor); Sensor value (Reading value); number occurrence value (number of occurrence of the value). I would like to be able to program the "number of occurrences value" measurement so that it can give me the number of times the value read has been taken or exceeded. Example on Excel with the "COUNTIFS" function:


Do you think it is possible to reproduce the same result in DAX measurement?

 

I thank you in advance

 

Have a good day

 

  • Anonymous , Try new meaures like

     

    value occurrence =countx(filter(allselected(Table), Table[value]>=Table[Value]),Table[Value])


    occurrence % = divide(countx(filter(allselected(Table), Table[value]>=Table[Value]),Table[Value]),countx(allselected(Table),Table[Value]))

2 Replies

  • Anonymous , Try new meaures like

     

    value occurrence =countx(filter(allselected(Table), Table[value]>=Table[Value]),Table[Value])


    occurrence % = divide(countx(filter(allselected(Table), Table[value]>=Table[Value]),Table[Value]),countx(allselected(Table),Table[Value]))

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi amitchandak and thank you but the measure is not working. Here is the result I get:

    For more information on my file, I attach below the code of the "Sensor value" measurement :

    I also attach the architecture of my Dataset to make it more understandable:

    Thank you in advance for your help