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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.