Forum Discussion

spandy34's avatar
spandy34
Responsive Resident
3 years ago
Solved

Count filtered time fields

I was wondering if you could help me please.  I want to create a measure called z_15min Commission the counts all the SSRef fields where there is   00:15:00 in the Planned Duration field.  Planned Duration is a Time format field .  I tried below but get an error.

 

Thank you very much

 

z_15min Commission = CALCULATE(
   COUNTA('Procurement_Main_Data'[SSRef]),
    'Procurement_Main_Data'[Planned Duration]= "00:15:00")
 
  • Ahmedx's avatar
    Ahmedx
    3 years ago

     

    z_15min Commission = CALCULATE(
       COUNTA('Procurement_Main_Data'[SSRef]), 
         'Procurement_Main_Data'[Planned Duration]>= TIMEVALUE("00:00:00")​&&
        'Procurement_Main_Data'[Planned Duration]<= TIMEVALUE("00:17:00")
    )

     

     

  • Ahmedx's avatar
    Ahmedx
    3 years ago

    no need to copy measure and paste. must be written by hand

9 Replies

  • write like this:

    z_15min Commission = CALCULATE(
       COUNTA('Procurement_Main_Data'[SSRef]),
        'Procurement_Main_Data'[Planned Duration]= TIMEVALUE("00:15:00"))
    • spandy34's avatar
      spandy34
      Responsive Resident

      That is great thank you.

       

      What would the DAX be if I wanted the Planned Duration between  0 and 17 mins as opposed to 15mins please?

  • I didn't understand you, is that what you mean?

    z_15мин Комиссия = РАСЧЕТ(
        COUNTA('Procurement_Main_Data'[SSRef]),
         'Procurement_Main_Data'[Запланированная продолжительность] = TIMEVALUE("00:17:00"))  

     

    • spandy34's avatar
      spandy34
      Responsive Resident

      Hi no . I want to Count SSRef where the 'Procurrment Main Data'[Planned Duration] is between 00:00:00 and 00:17:00

       

      thank you 

      • Ahmedx's avatar
        Ahmedx
        Super User

         

        z_15min Commission = CALCULATE(
           COUNTA('Procurement_Main_Data'[SSRef]), 
             'Procurement_Main_Data'[Planned Duration]>= TIMEVALUE("00:00:00")​&&
            'Procurement_Main_Data'[Planned Duration]<= TIMEVALUE("00:17:00")
        )