Forum Discussion
Total value for last 6 months.
- 2 years ago
like this?
- First I have taged my facts with 1 or 0 (calculated column)
- then I used this formula:CALCULATE( SUM(yourFactTable[Tag-column]), FILTER( yourFactTable, 1), DATESINPERIOD(DimDate[Date], MAX(DimDate[Date]), -6, MONTH))
Hope you got the idea.
Regards
Hey Vidya1882 ,
you expect stg like this, right?
...last 6 mths
...last 4 mths
used this formula for last 6 month:
Sum_last_6m = CALCULATE(
[Sum_Amt],
DATESINPERIOD(DimDate[Date], MAX(DimDate[Date]), -6, MONTH)
)
Pls adjust for your needs.
Regards
Hi sergej_og
Delivered total value = if(sum(DMT_HCP_PERSONA_NEW[DELIVERED]) >= 1 , 1,0)
if i use above this measure its give total 1 or 0.it not give the row of total value .for example: DMT_HCP_PERSONA_NEW[DELIVERED] is 65 for id 5 for july month, so this is greater than 1 right ,so it return 1 otherwise 0.same method for all months.in this case for all months value is 1 for 5 id .it should be total is 6.but it give the 1. need exact value is above
| HCP_ID | Jul | Aug | Sep | Oct | Nov | Dec | Total |
| 5 | 1 | 1 | 1 | 1 | 1 | 1 | 6 |
| 10 | 1 | 0 | 0 | 1 | 0 | 0 | 2 |
| 12 | 0 | 0 | 1 | 1 | 0 | 1 | 3 |
| 24 | 1 | 1 | 1 | 1 | 1 | 1 | 6 |
- sergej_og2 years ago
Super User
like this?
- First I have taged my facts with 1 or 0 (calculated column)
- then I used this formula:CALCULATE( SUM(yourFactTable[Tag-column]), FILTER( yourFactTable, 1), DATESINPERIOD(DimDate[Date], MAX(DimDate[Date]), -6, MONTH))
Hope you got the idea.
Regards