Forum Discussion

elouizi's avatar
elouizi
Helper II
6 years ago

previousmonth not working even with date column

I struggeling with one messaure that is giving me blanks as a results.
 
Flow_Website_CellPhone_PREVIOUSMONTH =
 
Mesaure1: Sum(Flow[Events]) 
CALCULATE( [Mesaure1];PREVIOUSMONTH(Flow[Date]);Flow[Flow]="Website_CellPhone")
 
First messaure works perfect. 
All the months have data.
column is date column.
 
When I create a second messure, it fails when using in a card visual or any other chart
 
I use a date as a column to generate the previous month. I have selected one month in my filter.
What am I doing wrong?
 
 
 
 
 

3 Replies

    • elouizi's avatar
      elouizi
      Helper II

      Thanks for sharing.

       

      I tried addmonth function and subtracted a month.

      But that did not work.

      Any other idea.

       

       

      • elouizi's avatar
        elouizi
        Helper II

        Hello everyone,

         

        Just created a table in power bi. with the following colums

        date

        currentEvent

        PreviuousMonth event.

         

        With these colums. It works.

        But when I remove the date colum and replace it with yearmonth. IT does NOT work. I get blank.

        It seems that it does not reconize yearmonth as a date but as text and PowerBI does not know how to deal with this.