Forum Discussion
Multiplication with Days Difference
- 6 years ago
Hi, michael_knight
I wonder if the 'Day difference' includes the created date or the current date.
If it includes the created date, you may try the following calculated column.
Result = var tab = ADDCOLUMNS( CALENDAR( 'Active Leads'[Created On], 'Active Leads'[Current Date]-1 ), "Value", var _weekday = WEEKDAY([Date]) return IF( _weekday in {2,3,4,5,7}, 7, IF( _weekday in {1,6}, 6 ) ) ) return SUMX( tab, [Value] )Result:
If it includes the current date, you may try the following calculated column.
Result = var tab = ADDCOLUMNS( CALENDAR( 'Active Leads'[Created On]+1, 'Active Leads'[Current Date] ), "Value", var _weekday = WEEKDAY([Date]) return IF( _weekday in {2,3,4,5,7}, 7, IF( _weekday in {1,6}, 6 ) ) ) return SUMX( tab, [Value] )Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
michael_knight , I am not clear on expected output. Can you explain with example
Hi amitchandak
I want to multiply the DATEDIFF value from the Created On and Current Date.
I want to multiply it by this figures
Monday-Thursday & Sunday - 7
Friday & Sunday - 6
We get a Lead (Created On) on Saturday for example. The difference between Saturday and Thursday (Current Date) is 5 days
So using the figures above, this will be the multiplication = 6 (Sunday) + 7 (Monday)+ 7 (Tuesday)+ 7 (Wednesday) + 7 (Thursday)
That means the outcome I want is 33
Hopefully that's a bit clearer