Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Previous Month calculation (only include months from current year where we have data)

Hi all,    I'm having a bit of a trouble with creating some measures correctly.  I want to have a bar-chart visualization of change in percentage for current month vs. previous month.    In the ...
  • v-diye-msft's avatar
    v-diye-msft
    6 years ago

    Hi Anonymous 

     

    I edited your measures with adding IF function, please kindly check whether it works for you:

    Previous Month = IF(ISBLANK([Total MonthlyMockUp]),BLANK(),CALCULATE( [Total MonthlyMockUp] , PREVIOUSMONTH( 'Date'[Date] )))

     

    % change = IF(ISBLANK([Previous Month]),BLANK(),DIVIDE( [Total MonthlyMockUp] , [Previous Month] , BLANK() ) - 1)

     

    Pbix attached,