Forum Discussion
Amitkr174
3 years agoHelper III
Date DAX Calculation
Hi, tamerj1 johnt75 parry2k Jihwan_Kim ThxAlot VahidDM I am trying to create a DAX for the below case:- IF ( (I:O createddate) > Case Completion Date), then (I:O createddate) - Case ...
tamerj1
3 years agoCommunity Champion
Calculated columns do not interact with the filter context. This has to be a measure
=
VAR T =
ALLSELECTED ( 'Table' )
RETURN
MAXX (
'Table',
IF (
'Table'[CreatedDate] > 'Table'[Case_Comp_date]
&& CALCULATE (
MIN ( 'Table'[CreatedDate] ),
T,
VALUES ( 'Table'[Opp_DealR] ),
VALUES ( 'Table'[CaseNumber] )
) = 'Table'[CreatedDate],
INT ( 'Table'[CreatedDate] - 'Table'[Case_Comp_date] )
)
)
Amitkr174
3 years agoHelper III
Still same issue is there.
- tamerj13 years agoCommunity Champion
Amitkr174
Apologies, your reply was overlooked somehow. Yes you are right there was a typo mistake.Please try
= VAR T = ALLSELECTED ( 'Table' ) RETURN MAXX ( T, IF ( 'Table'[CreatedDate] > 'Table'[Case_Comp_date] && CALCULATE ( MIN ( 'Table'[CreatedDate] ), T, VALUES ( 'Table'[Opp_DealR] ), VALUES ( 'Table'[CaseNumber] ) ) = 'Table'[CreatedDate], INT ( 'Table'[CreatedDate] - 'Table'[Case_Comp_date] ) ) ) - Amitkr1743 years agoHelper III
I am not able to send you the message. Error msg is below.
- Amitkr1743 years agoHelper III
Sample data tamerj1
Opp_DealR CaseNumber CreatedDate Case_Comp_date oldvalue Newvalue DR3622342 2197519 3/8/2023 2/26/2023 02 - Prospect 05 - Solution Definition and Validation DR3622342 2197519 5/25/2023 2/26/2023 05 - Solution Definition and Validation 06 - Customer Commit DR3622342 2197519 5/26/2023 2/26/2023 06 - Customer Commit Closed - Booked DR3622342 2197519 5/26/2023 2/26/2023 Closed - Booked 07 - Execute to Close DR3622342 2197519 6/1/2023 2/26/2023 07 - Execute to Close Closed - Booked DR3630255 2248914 3/20/2023 5/1/2023 01 - Pre Call Plan 02 - Prospect DR3630255 2248914 3/28/2023 5/1/2023 02 - Prospect 03 - Opportunity Qualification DR3630255 2248914 4/18/2023 5/1/2023 03 - Opportunity Qualification 04 - Circle of Influence DR3630255 2248914 5/18/2023 5/1/2023 04 - Circle of Influence 05 - Solution Definition and Validation