Forum Discussion
sum before a day
- 8 years ago
Hi Aliafshari
When you select a YEAR, a MONTH and a DAY, result would be a single date
SELECTEDVALUE pulls that date
see the attached file with your sample data
Hi Aliafshari
Try this MEASURE
Sum_Before_Selected_Day =
CALCULATE (
SUM ( TableName[Quantity] ),
FILTER (
ALL ( TableName ),
TableName[Date] < SELECTEDVALUE ( TableName[Date] )
)
)
Thanks for youre notice, Youre measure only depend on Date but I really want to first select Year, month and then day, how to add this filters in youre measure?
- Zubair_Muhammad8 years agoCommunity Champion
Hi Aliafshari
When you select a YEAR, a MONTH and a DAY, result would be a single date
SELECTEDVALUE pulls that date
see the attached file with your sample data
- Aliafshari8 years agoFrequent Visitor
Thank you Zubair_Muhammad
- Aliafshari8 years agoFrequent Visitor
Sorry Zubair_Muhammad
One more question, Consider we add a column name as Main account, how to sum before a day for each of main account in a table?
Date Main account Quantity
** ** **