cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
qwertzuiop
Advocate II
Advocate II

create a measure that counts same time

Dear PowerBI Community

 

First of all: Good luck for 2020!

 

I have the following question:

I want to create a measure that returns me the number of times the time 01:00 occurs in the column

 

For example, the measure for this table should return the number "4".

Think its not easy because its not an interger to check.

So the following expression does not work: 

measure = COUNTX(FILTER('table';[timeOfCreation]=01:00))

 

timeOfCreation
01:00
02:00
03:00
01:00
02:00
01:00
03:00
01:00

 

Thank you so much for your help.

 

Cheers!

qwertzuiop

1 ACCEPTED SOLUTION
AnkitBI
Solution Sage
Solution Sage

Hi @qwertzuiop 

 

Try below. If not working, then share the data type for timeOfCreation columns.

measure5 = COUNTX(FILTER('table5',[timeOfCreation]="01:00"),Table5[timeOfCreation])

 

Thanks
Ankit Jain
Do Mark it as solution if the response resolved your problem. Do Kudo the response if it seems good and helpful.

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

In case data is not in text format use either format or time to convert into another format

 

Like format(time,"HH:MM")

or time(01:00)

 

and then compare.  Keep data type same on both sides.

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/Winner-Topper-on-Map-How-to-Color-States-on-a-Map-wi...
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p...
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!
AnkitBI
Solution Sage
Solution Sage

Hi @qwertzuiop 

 

Try below. If not working, then share the data type for timeOfCreation columns.

measure5 = COUNTX(FILTER('table5',[timeOfCreation]="01:00"),Table5[timeOfCreation])

 

Thanks
Ankit Jain
Do Mark it as solution if the response resolved your problem. Do Kudo the response if it seems good and helpful.

View solution in original post

Helpful resources

Announcements
Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Top Solution Authors
Top Kudoed Authors