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
Qotsa
Helper V
Helper V

No results returned - USERELATIONSHIP

Hi,

 

Trying to get the total number of people (carers) starting & leaving the company.

 

I have 2 tables - A Calendar table & a Carers table.

 

I have a Many to one inactive rel-ship between the startdate & date columns in the Carers table & Calendar table.

I have a Many to one inactive rel-ship between the deleteddate & date columns in the Carers table & Calendar table.

 

Carers Started = CALCULATE(DISTINCTCOUNT('powerbi114 carer'[id]),
USERELATIONSHIP('powerbi114 carer'[startDate],'Calendar'[Date]))
 
Terminated Carers = CALCULATE(DISTINCTCOUNT('powerbi114 carer'[id]),
USERELATIONSHIP('powerbi114 carer'[deleted],'Calendar'[Date]))
 
I get the correct results for Carers Started measure but get no results for Terminated Carers measure and have no idea why.
2 REPLIES 2
amitchandak
Super User
Super User

@Qotsa , check the date 'powerbi114 carer'[deleted]  do not have timestamp. Change datatype to DateTime  and the format to include time

 

If there is then create a date

deleted date = 'powerbi114 carer'[deleted].date

or

deleted date = date(year( 'powerbi114 carer'[deleted]),month( 'powerbi114 carer'[deleted]),day( 'powerbi114 carer'[deleted]))

I had thought of that and had no timestamp.

 

But I did needed to remove the timestamp in the query editor.

 

Now it works.

 

Thanks a milllion!

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.