cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Nita
Helper II
Helper II

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 IV
Super User IV

@Nita , 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.



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

3 REPLIES 3
amitchandak
Super User IV
Super User IV

@Nita , 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.



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

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

Thanks Amit.

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

March Update

Check it Out!

Click here to read more about the March 2021 Updates!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

secondImage

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.