Forum Discussion

prvn's avatar
prvn
Frequent Visitor
7 years ago
Solved

Previous month and Current month values are same

I'm building a report, the matrix should show current and previous month figures. When i tried both current and previous columns show same values.

 

 

I have tried multiple ways for the calculated previous month column using DAX as shown below by refering to multiple posts

 

Previous Active = VAR prevMonth =MONTH(TODAY()) - 1 RETURN CALCULATE(
	SUM(ViewClashDetection[Active]),
	FILTER(ALL(DimDate[Month]), VALUE(DimDate[Month]) = prevMonth)
)

Previous Active= VAR prevMonth = DATESINPERIOD(DimDate[Date],TODAY(),-2,MONTH) RETURN CALCULATE(
	SUM(ViewClashDetection[Active]),
	DATESBETWEEN(DimDate[Date],[Measure 5],[Measure 4])
)

Previous Active = CALCULATE(
	SUM(ViewClashDetection[Active]),
	DATEADD(DimDate[Date], -1, MONTH)
)

 

 

 

 

5 Replies

    • prvn's avatar
      prvn
      Frequent Visitor

      Thanks for the respose. Will this solution work if there is data missing for weeks in between?

      I was unable to open the pbix as i need to update power bi app. I'm currently using 2.67.