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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
KMcCarthy9
Helper IV
Helper IV

DAX for CALCULATE Using a Column with a Date as Filter

Hi I have a table that holds a identifier column and a max_eff date column. 

 

I'm trying to do a simple Calculate formula to obtain a count for all the assetnums that have a max_eff date of 1/1/2021, however every result is returning BLANK. I know the issue if the way I am trying to filter on the max_effect column. Any suggestions? 
I do have the table connected to my date table and have tried using DATE = 1/1/2021 but that also returned BLANK. 

DAX:

 

2021 Starting Asset Count = CALCULATE(COUNTA('Program Status'[assetnum]), 'Program Status'[max_effdate] = 1/1/2021)

 


TABLE:

KMcCarthy9_0-1634763131752.png

 

Thanks!

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

One of these should work

2021 Starting Asset Count = CALCULATE(COUNTA('Program Status'[assetnum]), 'Program Status'[max_effdate] = DATE(2021,1,1))
2021 Starting Asset Count = CALCULATE(COUNTA('Program Status'[assetnum]), FILTER('Program Status','Program Status'[max_effdate] = DATE(2021,1,1)))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

One of these should work

2021 Starting Asset Count = CALCULATE(COUNTA('Program Status'[assetnum]), 'Program Status'[max_effdate] = DATE(2021,1,1))
2021 Starting Asset Count = CALCULATE(COUNTA('Program Status'[assetnum]), FILTER('Program Status','Program Status'[max_effdate] = DATE(2021,1,1)))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur Both work. Thank you!

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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