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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
LeighMacKay
Helper I
Helper I

Count columns containing date & time

Hi all,

Firstly apologies if the explanation of what I am trying to achieve has been done on another post AND if it isn't very clear.
I am hoping somebody can help me out as I am going round in circles and wasting time.

Background info:

We sent out some account activations to our users, for our new web based product and have two different types of registrations being recorded.
1) They activate using the link sent over by email, which creates a date and time stamp in the database.

Activation is captured in a table called activity_log in a field called Activation as dd/mm/yyyy hh:mm:ss


2) They never received the link (reason why doesn't matter), but then register themselves directly on the website.
This is classed as a Registration.  When complete it updates the table to say the date and time that they registered in a field called Registrations which is also in the activity_log table (again as dd/mm/yyyy

 

As both aren't numbers.  How would I count the total number of each (in a measure?)
Basically if it is NULL or BLANK. I don't want to count that column.  But if it has the date and time in the field I want to count that as a activation or registration, depending on the way in which they have registered.

database: eventminder_a_trinity.
table: activity_log.
1) column name = activations

2) column name = registrations.

Just to add a spanner in the works.  I want my filters to be able to interact with the results.  The Count of both I want to appear as a number using the card visual (eg: total number of activations = 985), so it's just a count of those fields containing date and time but NOT blanks and/or nulls.
I am happy to add an additional column in the dataset if required. eg: where it contains dd/mm/yyyy and hh:mm:ss = 1. Where blank or null = 0.

I understand the logic.  Just not the DAX which enables me to do it. 

 

 

2 REPLIES 2
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @LeighMacKay,

Due to it is hard to reproduce your data, could you please offer some sample data to have a test and post your desired result if possible? Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi,

 

Apologies that I am only just getting back to you, I appreciate your response.

Commission & Event Value table names are actually as follows ...
Commission = 'tblEvents'[approxCommission]
Event Value = 'tblEvents'[approxValue]

I've got the total values in at the bottom of each column to show what I should be getting based on the filters that are being applied.  Any hints or tips to make my cards work would be greatly appreciated.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors