Forum Discussion
dax formula
- 6 years ago
Anonymous
Thank you, I modified the file a bit (added added a date table and updated the measure) and attached it.
One of my criteria is that different product has a start date.
So the no. of months to divide is different
is it possible?
We just need to modify the measure a bit to do the correct caluculation.
Value in range =
VAR StartDate = FIRSTDATE('Table'[Date])
VAR SelectedNumber = MAX ( SELECTEDVALUE ( Numbers[Number] ) -1, 0)
VAR EndDate = DATEADD(StartDate,SelectedNumber,MONTH)
RETURN
CALCULATE(
[Value Amount], ALL ( 'Table' ), DATESBETWEEN( 'Table'[Date],StartDate,EndDate) ) / SelectedNumber * 12
- Anonymous6 years agoNot applicable
- jdbuchanan716 years ago
Super User
That is the measure that just adds up the value column. In your first post, item 3.
- Anonymous6 years agoNot applicable
jdbuchanan71
need your help again.
I tried the forumla but it doesnt seem to give me the correct value.For example if i select Product A, Jan-Aug, total sales = 445
if user selected number '8', the answer should be 667.5 instead of the following?
- jdbuchanan716 years ago
Super User
Anonymous
Please share your .pbix file, the one you took the screen shot from so I can see how you have the model and report set up.
- Anonymous6 years agoNot applicable
Here it is
jdbuchanan71 - jdbuchanan716 years ago
Super User
Anonymous
Thank you, I modified the file a bit (added added a date table and updated the measure) and attached it.
- Anonymous6 years agoNot applicable
Thank you so much!It worked.