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

Trying to Get DATEDIFF to work but it's not.

hi all, 

 

I'm trying to get this formula to work 

 

DATEDIFF(ProviderAccountMaster[CreatedDT],RELATED(AccountMaster[CreatedDT], DAY)
 
how ever it is not. i'm getting the Error (Too many arguments were passed to the RELATED function. The maximum argument count for the function is 1.) 
 
And i also get the related tables error (The column 'AccountMaster[CreatedDT]' either doesn't exist or doesn't have a relationship to any table available in the current context.) but i have them related. 
 
I have them related so i'm a bit confused. 
tables i'm using for DATEDIFF funtiontables i'm using for DATEDIFF funtion
3 REPLIES 3
MFelix
Super User
Super User

Hi @Anonymous ,

 

Believe that your issue is related with parentenses. Try to modify your calculation to the following:

 

DATEDIFF (
    ProviderAccountMaster[CreatedDT],
    RELATED ( AccountMaster[CreatedDT] ),
    DAY
)

Regards,

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

done that but still getting this error. 

The column 'accountMaster[CreatedDT]' either doesn't exist or doesn't have a relationship to any table available in the current context.

 

NewAccounts = DATEDIFF(MAX(ProviderAccountMaster[CreatedDT]), RELATED(accountMaster[CreatedDT]), DAY)
 
any sugguestions with the below relationships? 
 
BICapture.PNG
 

 

Hi @Anonymous ,

 

Can you share a sample file, if the data is sensitive can you share it trough private message or with mockup data?

 

Regards,

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



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.