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

using datediff with filters

hi,

i have this formula, it gave me big numbers which i think because i used sum after (claculate) i dont want to sum it, but calculate function does not allow to continue with me using sum,count,min...

i need to calculate a date difference with a filter in a third coulumn, so the desiered coulumns give months numbers and the others give blank. still trying but posting this question in the meantime

 

No_of_months since opened1 = DATEDIFF ('EVS Account'[Date_Opened],CALCULATE(SUM('EVS Account'[Date_action_code1].[Date]),FILTER('EVS Account','EVS Account'[Action_Code]="P")),MONTH)

 

thanks alot 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: using datediff with filters

Hi @Ranahazim

I can reproduce your problem, i would suggest you to create a calculated column like this

Column = IF([Action_Code]="P",DATEDIFF([Date_Opened],[Date_action_code1],MONTH))

3.png

 

Or a measure

Measure = IF(MAX([Action_Code])="P",DATEDIFF(MAX([Date_Opened]),MAX([Date_action_code1]),MONTH))

Best Regards

Maggie

1 REPLY 1
Community Support Team
Community Support Team

Re: using datediff with filters

Hi @Ranahazim

I can reproduce your problem, i would suggest you to create a calculated column like this

Column = IF([Action_Code]="P",DATEDIFF([Date_Opened],[Date_action_code1],MONTH))

3.png

 

Or a measure

Measure = IF(MAX([Action_Code])="P",DATEDIFF(MAX([Date_Opened]),MAX([Date_action_code1]),MONTH))

Best Regards

Maggie

Helpful resources

Announcements
Community Highlights

Community Highlights

Find out what's new in the Power BI Community!

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 317 members 2,876 guests
Please welcome our newest community members: