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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
qwertzuiop
Advocate III
Advocate III

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

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.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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