cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vjackman Frequent Visitor
Frequent Visitor

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. 
BICapture.PNGtables i'm using for DATEDIFF funtion
3 REPLIES 3
Super User
Super User

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

Hi @vjackman ,

 

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



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

Proud to be a Datanaut!




vjackman Frequent Visitor
Frequent Visitor

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

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
 

 

Super User
Super User

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

Hi @vjackman ,

 

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

 

Regards,

MFelix



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

Proud to be a Datanaut!




Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 66 members 1,231 guests
Please welcome our newest community members: