cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dinoscool3
Frequent Visitor

Dynamic date filtering by column?

I have data with registrations for the past two years, each registration is attached to a group and I've created a matrix with how many registrations each group has.

 

I want to next create a matrix with each column showing registrations by group in X days, 30, 60, 90, 6 months, etc. I know I can do a dynamic filter but that effects the entire table.

 

I've tried creating measures for each column but the DAX expressions aren't returning what I want it to. For example, when I try DATEINPERIOD I get an error because there are date repeats. I've tried a few others to filter but it doesn't seem to work.

 

For example:

 

 

 

Measure 2 = CALCULATE(COUNT('Schools over 5registrations'[email]),DATESINPERIOD('Schools over 5 registrations'[created_at],TODAY(),-1,MONTH))

 

 

 

 

Any ideas for a DAX expression to do dynamic filtering for each column?

1 ACCEPTED SOLUTION
amitchandak
Super User IV
Super User IV

@dinoscool3 , You should use date table for time intelligence

 

Measure 2 = CALCULATE(COUNT('Schools over 5registrations'[email]),DATESINPERIOD('SDate'[Date],TODAY(),-1,MONTH))

 

 

 

before joining make sure created_at do not have timestamp , other wise create a date first

 

example

Date = [datetime].date
or
Date = date(year([datetime]),month([datetime]),day([datetime]))

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

1 REPLY 1
amitchandak
Super User IV
Super User IV

@dinoscool3 , You should use date table for time intelligence

 

Measure 2 = CALCULATE(COUNT('Schools over 5registrations'[email]),DATESINPERIOD('SDate'[Date],TODAY(),-1,MONTH))

 

 

 

before joining make sure created_at do not have timestamp , other wise create a date first

 

example

Date = [datetime].date
or
Date = date(year([datetime]),month([datetime]),day([datetime]))

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

Top Solution Authors
Top Kudoed Authors