Forum Discussion
difference between to fact table columns based on conditions involving a fact and dim table
- 4 years ago
KV2022 , If both dates are in Fact, use related(Dim[Date]) if date is in dimension
Calculate(Sumx(Table, Datediff([Date1], [Date2], day) , filter(Table,Table[Col] = "ABC"), Filter(Dim, Dim[Col] ="ABC") )
You can use Averagex in place of sumx
KV2022 , If both dates are in Fact, use related(Dim[Date]) if date is in dimension
Calculate(Sumx(Table, Datediff([Date1], [Date2], day) , filter(Table,Table[Col] = "ABC"), Filter(Dim, Dim[Col] ="ABC") )
You can use Averagex in place of sumx
thanks.
But the dates are in fact table and so is the flag. Something like this
fact(actual end date)- fact(actual start date) on fact(flag) = value and dim(column) = value.
it needs to be a measure
- amitchandak4 years ago
Super User
KV2022 , If values are coming from the slicer, you do not need even add filter code
Also, I suggested a measure only
If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.- KV20224 years ago
Helper II
thanks.I will try that