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
Anonymous
Not applicable

Get data from a column by comparing the date in a different table

I have Combine2020 = column A: values are "Yes" and "No". Column B:"Created Date", Column C="ID".  
Table B: Has "Published date" and "ID"

ID is 1-many relationship from Table B to Table A.

This is what I have: Yes = CALCULATE(Count('Combine2020'[Is Useful?]),FILTER('Combine2020','Combine2020'[Is Useful?]="Yes"). This will give be count of "Yes" for unique ID.

"Is Useful?" has values of "Yes" an "No".

Now I want to modify the above calculation to get the count when the Created Date is before the Published date.

 

Thanks

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Try like

CALCULATE(Count('Combine2020'[Is Useful?]),FILTER('Combine2020','Combine2020'[Is Useful?]="Yes" && 'Combine2020'[Created Date]<=related('Table B:'[Published date])))

 

 

Please provide your feedback comments and advice for new videos
Tutorial Series Dax Vs SQL Direct Query PBI Tips
Appreciate your Kudos.

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , Try like

CALCULATE(Count('Combine2020'[Is Useful?]),FILTER('Combine2020','Combine2020'[Is Useful?]="Yes" && 'Combine2020'[Created Date]<=related('Table B:'[Published date])))

 

 

Please provide your feedback comments and advice for new videos
Tutorial Series Dax Vs SQL Direct Query PBI Tips
Appreciate your Kudos.

Anonymous
Not applicable

Hello Amit:

If I want to get the values from [Created date] for just 3 months from [Published date], how would I change DAX?

Thanks

Anonymous
Not applicable

Thanks Amit.

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.