Forum Discussion
Agreenwood
8 years agoHelper I
DAX - Using Filter to Sum All Months by Working Day
Hi, Fairly new to DAX and been frustrated all day trying to figure this one out. There is probably a simple answer. I have a 'Dates' table which has 2 columns: 1) 'Date' (2) 'Working Day' whi...
- 8 years ago
Hi Agreenwood,
According to your formulas, it seems the monthly revenue will be accumulated. Maybe you can try these formula below. You can check it out in this file.
Measure 2 = TOTALYTD ( SUM ( Revenues[Revenue] ), Dates[Date], FILTER ( ALL ( 'Dates' ), 'Dates'[WorkingDay] <= MAX ( Dates[WorkingDay] ) ) )Measure = TOTALMTD ( SUM ( Revenues[Revenue] ), 'Dates'[Date] )
Best Regards,
Dale
Agreenwood
8 years agoHelper I
Ok, I think I may have answered my own question with the following measure:
MtD Revenue = CALCULATE(SUM(Revenue[Revenue]), FILTER(ALL(Dates), Dates[workingday] <= MAX(Dates[workingday])), FILTER(ALL(Dates), Dates[Date] <= MAX(Revenue[date])))
Are there any alternative ways of completing the same, or better ways maybe?
v-jiascu-msft
8 years agoMicrosoft Employee
Hi Agreenwood,
According to your formulas, it seems the monthly revenue will be accumulated. Maybe you can try these formula below. You can check it out in this file.
Measure 2 =
TOTALYTD (
SUM ( Revenues[Revenue] ),
Dates[Date],
FILTER ( ALL ( 'Dates' ), 'Dates'[WorkingDay] <= MAX ( Dates[WorkingDay] ) )
)Measure = TOTALMTD ( SUM ( Revenues[Revenue] ), 'Dates'[Date] )
Best Regards,
Dale