Forum Discussion
Date DAX Calculation
=
IF (
'Table'[CreatedDate] > 'Table'[Case_Comp_date]
&& CALCULATE (
MIN ( 'Table'[CreatedDate] ),
ALLEXCEPT ( 'Table', 'Table'[Opp_DealR], 'Table'[CaseNumber] )
) = 'Table'[CreatedDate],
INT ('Table'[CreatedDate] - 'Table'[Case_Comp_date] )
)
Thanks tamerj1 - it is working fine for one Deal Number but when I am selecting another one it is getting blank.
When I select DR3630255, it is not showing in the first table though it has a Createddate > Case Comp date i.e. 18th May. Please advise.
- tamerj13 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] )
)
) - Amitkr1743 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