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

Dates mess

Hi,

I have a table with several dates columns that I need to use. But I'm not getting the results I want.

I've created a dates tabel, and created a relationship between the dates columns that I need and the dates table:

relationship.jpg

My dates columns:

datecolumns.jpg

So, e.g, I'm trying to count candidates added last month:

CandidatesLast30 = CALCULATE(COUNT(Assignments[CandidateId]); PREVIOUSMONTH(Dates[Date].[Date]))

But it gives me blank result.

This gives me an error:

CandidatesLast30 = CALCULATE(COUNT(Assignments[CandidateId]); PREVIOUSMONTH(Assignments[DateAddedCandidate]))

I've also tried this without results:

CandidatesLast30 = CALCULATE(COUNT(Assignments[CandidateId]); USERELATIONSHIP(Assignments[DateAddedCandidate]; Dates[Date]);DATESYTD(Dates[Date].[Date]))

Can any one point me in the direction of what I'm doing wrong?

 

1 ACCEPTED SOLUTION

@Anonymous 

Adding a relationship between tables and creating calculations using those relationships will solve this issue. Here is a group of relationship blogs to help.

https://powerpivotpro.com/category/skill-areas/relationships/





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

12 REPLIES 12

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.