Forum Discussion
Anonymous
2 years agoNot applicable
Issues with Month[today]
I have a formula: 6month Prior = CALCULATE(SUM('Sales Data'[sales_price]), FILTER('Sales Data','Sales Data'[Month Match] = true && 'Sales Data'[Month if Matching] = [Current Month]-6))/ CALCUL...
- 2 years ago
Anonymous I would recommend using EOMONTH. You can use a pattern such as:
Measure = VAR __Today = TODAY() VAR __Max = EOMONTH( __Today, -6 ) VAR __Min = DATE( YEAR( __EOM6 ), MONTH( __EOM6 ), 1 ) VAR __Table = FILTER( ALL( 'Sales Data' ), [Date] >= __Min && [Date] <= __Max ) VAR __Result = SUMX( __Table, [sales price] ) RETURN __ResultOr do you not have a Date column?
Anonymous
2 years agoNot applicable
I just figured it out, but still need help with a solution.
6month Prior = CALCULATE(SUM('Sales Data'[sales_price]), FILTER('Sales Data','Sales Data'[Month Match] = true && 'Sales Data'[Month if Matching] = [Current Month]-6))/ CALCULATE([# of WorkDays], FILTER('Date Key', 'Date Key'[Month] = [Current Month] -6))
it works except for 6+ months prior because we are in June (month 6) -6 is 0. But I need to now go back to 12/2023. Any ideas are appreciated!!