Forum Discussion
PBIDEV_10
Helper II
4 years agoIf condition on month
Hi I am calculating current month values by current month - previous month values (PREVIOUSMONTH function). But for january month, it is displaying values for december last year which is wrong with ...
- 4 years ago
PBIDEV_10 , Try a measure like
Measure =
var _min = minx(allselected('Date)', Date[Date])
return
if(Min('Date'[Date]) =_min , 0, CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH))) )
PBIDEV_10
Helper II
4 years agoamitchandak Yes. I have date table and I am using date from that table for time intelligence functions. My issue is all other previous month values from february comes correct. only for the month of january, I want to show zero value.
New members last month = CALCULATE(SUM([New members]),PARALLELPERIOD(Kalender[Dato],-1,MONTH))
amitchandak
Super User
4 years agoPBIDEV_10 , Try a measure like
Measure =
var _min = minx(allselected('Date)', Date[Date])
return
if(Min('Date'[Date]) =_min , 0, CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH))) )