Forum Discussion
Anonymous
2 years agoNot applicable
Date Difference between 2 Columns
Hello,
I have a 2 table with
table A contains Start & End dates as of which i need to calculate the difference between them
Table B contains 2 other columns which i need to use as a filter.
The dax formula used is as below, but the result is far from right (it should give me only around 21 weeks but it is giving me 72 weeks
No.of Fabrication Weeks =
VAR SelectedActivityDescription = SELECTEDVALUE(ActivtiyLevelProgress[ActivityDescription])
VAR SelectedCustomText01 = SELECTEDVALUE(Equipment[CustomText01])
VAR TotalDuration =
CALCULATE(
SUMX(
Equipment,
IF(
Equipment[CustomText01] = SelectedCustomText01,
DATEDIFF(Equipment[InstallationStart], Equipment[InstallationEnd], WEEK)
)
),
FILTER(
ActivtiyLevelProgress,
ActivtiyLevelProgress[ActivityDescription] = SelectedActivityDescription &&
ActivtiyLevelProgress[Progress] = 100
)
)
RETURN
TotalDuration
Sample Dataset
Sample Dataset
what did go wrong in the Dax formula ?
2 Replies
- some_bihCommunity Champion
Hi Anonymous without model, it is hard to spot what could be wrong. Still, please check FILTER part of CALCULATE (ActivtiyLevelProgress[Progress] = 100)
- AnonymousNot applicable
The model size is big and contains alot on confidential data.
I have uploaded a sample of the Data in excel in the orginal post,kindly check if you can please.