Forum Discussion
CurrentMonthdate formula
- 5 years ago
bilalkhokar73 , second formula is assuming you have a date table . I saw ALL(date) in your formula, thought that you have date table.
If not please create a date table and use that
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
- 5 years ago
Hi bilalkhokar73 ,
Try the following formula:
Current_Month = CALCULATE( SUM(salesT[amt]), FILTER( ALL('date'), 'date'[Date] >= EOMONTH( TODAY(), -1 ) + 1 && 'date'[Date] <= EOMONTH( TODAY(), 0 ) ) )If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
WinnizIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- 5 years ago
Hi bilalkhokar73 ,
Try the following formula:
Current_Month = var FirstDay = CALCULATE( SUM(salesT[amt]), FILTER( ALL(salesT), 'salesT'[date] >= EOMONTH( MAX(salesT[date]), -2 ) + 1 && 'salesT'[date] <= EOMONTH( MAX(salesT[date]), -1 ) ) ) var OtherDays = CALCULATE( SUM(salesT[amt]), FILTER( ALL(salesT), 'salesT'[date] >= EOMONTH( MAX(salesT[date]), -1 ) + 1 && 'salesT'[date] < MAX(salesT[date]) ) ) return IF( MAX(salesT[date]) = EOMONTH( MAX(salesT[date]), -1 ) + 1, FirstDay, OtherDays )If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
WinnizIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
CALCULATE(SUM(salesT(amt)), datesmtd(dateadd(Date[date],-1,day)) giving blank result
other formula not accepting as asking date measures
bilalkhokar73 , second formula is assuming you have a date table . I saw ALL(date) in your formula, thought that you have date table.
If not please create a date table and use that
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.