Forum Discussion
Anonymous
8 years agoNot applicable
Multiply Daily Value by Monthly Value
I have 2 tables, 1 has monthly data and one has daily data.
I want to multiply my daily value by my monthly value in a measure so I can later splice the sum of cost per month
Sample Data:
| Monthly Data | |
| Date | Rate |
| 1/1/2018 | 2 |
| 2/1/2018 | 3 |
| 3/1/2018 | 4 |
| Daily Data | (Desired output) | |
| Date | Amount | Cost |
| 1/1/2018 | 10 | 20 |
| 1/2/2018 | 11 | 22 |
| 1/3/2018 | 12 | 24 |
| 1/4/2018 | 11 | 22 |
| 2/1/2018 | 10 | 30 |
| 2/2/2018 | 11 | 33 |
| 2/3/2018 | 11 | 33 |
| 2/4/2018 | 10 | 30 |
| 3/1/2018 | 10 | 40 |
| 3/2/2018 | 10 | 40 |
| 3/3/2018 | 11 | 44 |
| 3/4/2018 | 12 | 48 |
6 Replies
- AnonymousNot applicable
Try this:
[Cost] = SUMX ( DailyTable, DailyTable[Amount] * LOOKUPVALUE ( MonthlyTable[Rate], MonthlyTable[Date], DailyTable[Date] ) )- AnonymousNot applicable
Thanks for your reply!
Unfortunately this measure returns [first day of the month] * [monthly rate ] ; not a sum of the cost each day per month
- Zubair_Muhammad
Community Champion
Anonymous
Try this MEASURE
CostMeasure = CALCULATE ( SUM ( MonthlyTable[Rate] ), FILTER ( MonthlyTable, MONTH ( SELECTEDVALUE ( DailyTable[Date] ) ) = MONTH ( MonthlyTable[Date] ) ) ) * SUM ( DailyTable[Amount] )