Forum Discussion
Anonymous
8 years agoNot applicable
Nested if error in dax formula
Hi experts I have the following VAR was formula which does not work with certain visuals. I have a year slicer and a month slicer when I select year then month the result should be 112 months ba...
- 8 years ago
Hi Anonymous,
Add the following measure yo your model:
Datefilter12Month = VAR MonthsToLookBack = 12 VAR DataTableDate = MAX ( 'DimDate'[Date] ) RETURN CALCULATE ( SUM ( Sales[Sales] ); DATESINPERIOD ( dimDate[Date]; DataTableDate; - MonthsToLookBack; MONTH ) )See attach a PBIX file I prepared with a similar setup than yours.
Regards.
MFelix
Anonymous
8 years agoNot applicable
Hi I can share a file...Can you delete after solution..or would drop box link be better
MFelix
Super User
8 years agoShare the file trough private message wirth a dropbox link.
Regards
MFelix
Regards
MFelix
- Anonymous8 years agoNot applicable
Sent.
Can you confirm receipt. Also from the table that does not have sales date you'll need to create a month and year column to that data set. Or the sales table data set. Also as I was in a rush to create a sample file did not have time to label tables correctly- sorry.
- MFelix8 years ago
Super User
Hi Anonymous,
Got the file.
One confirmation you want to calculate the sum of sales 12 months back from the selected date correct?
Regards,
MFelix
- Anonymous8 years agoNot applicable
Yes...on two filters year and month