Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
spandy34
Responsive Resident
Responsive Resident

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")
 
2 ACCEPTED SOLUTIONS

 

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")
)

 

 

View solution in original post

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

View solution in original post

9 REPLIES 9
Ahmedx
Super User
Super User

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
Responsive Resident
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 

 

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")
)

 

 

spandy34
Responsive Resident
Responsive Resident

Hi Ive solved it - I put a space before && and its worked.

 

Thank you so much for your help @Ahmedx

spandy34
Responsive Resident
Responsive Resident

I get this error message

 

spandy34_0-1678868018805.png

 

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

spandy34
Responsive Resident
Responsive Resident

Thank you - your a star 

Ahmedx
Super User
Super User

write like this:

z_15min Commission = CALCULATE(
   COUNTA('Procurement_Main_Data'[SSRef]),
    'Procurement_Main_Data'[Planned Duration]= TIMEVALUE("00:15:00"))
spandy34
Responsive Resident
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?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.