Forum Discussion
Dividing Values to a Constant Interval Date
- 6 years ago
Hi Anonymous ,
Please refer to my .pbix file.
Measure 3 = IF( SELECTEDVALUE(Sheet2[Weekday]) = SELECTEDVALUE('Table'[_Weekday]) && SELECTEDVALUE(Sheet2[Date]) > DATE(2020, 3, 7), DIVIDE( SELECTEDVALUE(Sheet2[Amount]), SELECTEDVALUE('Table'[_Amount] ) ) )Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
I created some sample data on my desktop, and I hope the result is what you want.
Column = VAR TEST = CALCULATE(MIN('Table'[DATE]),ALL('Table'))
RETURN IF('Table'[DATE] = TEST,0,IF(WEEKDAY('Table'[DATE]) = WEEKDAY(TEST),1,2))Measure 8 = DIVIDE(CALCULATE(SUM('Table'[VALUE]),'Table'[Column] = 1),CALCULATE(SUM('Table'[VALUE]),FILTER(ALL('Table'[DATE],'Table'[Column]),'Table'[Column] = 0)))
Please try.
Aiolos Zhao
Hello,
Anonymous v-lionel-msft
Both answers didn't work Let me clarify myself I think I didn't express myself well.
My table is on the link as excel file ( https://bit.ly/2ZZbsCT ). the first week is my control week (1-7 march) and starting from 8th Mar, I want all sundays (8, 15, 22 Mar, etc) to be divided by 1st Mar, all thursdays (12, 19, 26 Mar, etc) to be divided by 5th March, etc.
By the way, I'm showing one of the product code as an ex. There are a lot more.
- v-lionel-msft6 years ago
Community Support
Hi Anonymous ,
Please refer to my .pbix file.
Measure 3 = IF( SELECTEDVALUE(Sheet2[Weekday]) = SELECTEDVALUE('Table'[_Weekday]) && SELECTEDVALUE(Sheet2[Date]) > DATE(2020, 3, 7), DIVIDE( SELECTEDVALUE(Sheet2[Amount]), SELECTEDVALUE('Table'[_Amount] ) ) )Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous6 years agoNot applicable
It seems working. Thanks a lot for your help!