Quantcast
Channel: Desktop topics
Viewing all articles
Browse latest Browse all 217069

DAX Previous Month Function Not working

$
0
0

Hi,

 

I have a simple excel sheet with 2 columns(Month, Sales) with sales related data for 4 months.

 

And all i am trying to do is create a new colum which gives me last month's sales using a DAX function against each month.

 

I have tried measures with following calculations

 

Measure_TotalSales = SUM('Sheet1 (2)'[sales])

 

Measure_PrevMonthSales = CALCULATE([Measure_TotalSales],dateadd('Sheet1 (2)'[Month],-1,MONTH))

 

Measure_PrevMonnth_PREVIOUSMONTH = CALCULATE(SUM('Sheet1 (2)'[sales]),PREVIOUSMONTH('Sheet1 (2)'[Month]))

 

I have tried to create a calculated column with following calculations

 

Column_PrevMonthSales = CALCULATE([Measure_TotalSales],dateadd('Sheet1 (2)'[Month],-1,MONTH))

 

-------------------------------------------------------------------------------------------------------------------------------

on top of that i have also tried

 

http://www.dutchdatadude.com/power-bi-pro-tip-making-date-time-calculations-work-time-intelligence/

 

and downloded  files from Web and copied formulas as specified in the following link

 

http://powerbi.tips/2016/07/measures-month-to-month-percent-change/

 

followed step by step as specified the teh link above, but i still see blank rows for the prev month calc.

 

Could this be a bug or do i need to use a different version of PBI desktop?

 

 

 

 

 


Viewing all articles
Browse latest Browse all 217069

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>