Forum Discussion
Datesbetween - need help with dax measure
- 7 years ago
Hi AlexanderAT,
Based on my test, you could refer to below formula:
Measure = CALCULATE ( SUM ( Table1[Turnover. FBP] ), FILTER ( 'Table1', MONTH ( 'Table1'[YearMonthShort] ) < MONTH ( TODAY () ) && YEAR ( 'Table1'[YearMonthShort] ) = YEAR ( TODAY () ) ) ) - CALCULATE ( SUM ( Table1[Budget - FBP] ), FILTER ( 'Table1', MONTH ( 'Table1'[YearMonthShort] ) < MONTH ( TODAY () ) && YEAR ( 'Table1'[YearMonthShort] ) = YEAR ( TODAY () ) ) )Result:
You could also download the pbix file to have a view.
Regards,
Daniel He
Hi AlexanderAT,
Based on my test, you could refer to below steps:
Sample data:
Measure:
Measure = CALCULATE(SUM(Table1[Value]),FILTER('Table1',MONTH('Table1'[Date])<MONTH(TODAY())))
Result:
If I have misunderstand you, could you please share the sample data and post your desired result if possible?
Regards,
Daniel He
- AlexanderAT7 years agoHelper I
Hello Daniel and thanks for writing.
One dimension the measure is missing is that it has to be the current year.
Here is a data sample and my desired result is the budget target:
https://drive.google.com/file/d/1pLXldp4JT80qxUJ8gOWjzq3hTfizmO3B/view?usp=sharing
- v-danhe-msft7 years agoMicrosoft Employee
Hi AlexanderAT,
Based on my test, you could refer to below formula:
Measure = CALCULATE ( SUM ( Table1[Turnover. FBP] ), FILTER ( 'Table1', MONTH ( 'Table1'[YearMonthShort] ) < MONTH ( TODAY () ) && YEAR ( 'Table1'[YearMonthShort] ) = YEAR ( TODAY () ) ) ) - CALCULATE ( SUM ( Table1[Budget - FBP] ), FILTER ( 'Table1', MONTH ( 'Table1'[YearMonthShort] ) < MONTH ( TODAY () ) && YEAR ( 'Table1'[YearMonthShort] ) = YEAR ( TODAY () ) ) )Result:
You could also download the pbix file to have a view.
Regards,
Daniel He
- AlexanderAT7 years agoHelper I
Works perfect. Thank you!