Forum Discussion

mariases94's avatar
mariases94
Helper III
4 years ago

PREVIOUSMONTH

Good morning,

 

I have a problem with a PREVIOUSMONTH "mesure".

 

I use this: 

PREV_MONTH_abiertas = CALCULATE(Oportunidades[COUNT_MARIA_OPO_ABIERTAS],PREVIOUSMONTH(Oportunidades[Fecha de creación]))

 

And returns me this: 

 

Can someone help me?

 

Thanks a lot.

 

 

 

 

 

9 Replies

  • PREVIOUSMONTH(DISTINCT(Oportunidades[Fecha de creación])))

    use  DISTINCT  function hope it will helps you

      • mh2587's avatar
        mh2587
        Super User

        Hi create date table with single of date then relate date column with Oportunidades 

  • mariases94 , please use date table and mark that as date table

     

    PREV_MONTH_abiertas = CALCULATE(Oportunidades[COUNT_MARIA_OPO_ABIERTAS],PREVIOUSMONTH('Date'[Fecha]))

     

    assuming COUNT_MARIA_OPO_ABIERTAS is a measure

     

    Why Time Intelligence Fails - Power bi 5 Savior Steps for TI: https://youtu.be/OBf0rjpp5Hw

    • mariases94's avatar
      mariases94
      Helper III

      Hi amitchandak , 

       

      I put your formula and returns me a "blank":

       

      PREV_MONTH_abiertas = CALCULATE(Oportunidades[COUNT_MARIA_OPO_ABIERTAS],PREVIOUSMONTH('CALENDAR'[Date]))
       

       

      In all date columns, I put date format. I don't know where is the error.

       

      Thanks a lot!

       
       
       
      • amitchandak's avatar
        amitchandak
        Super User

        mariases94 , have you selected any date on page(slicer or filter) , because if that is not there, then it will take first date as reference for last month and you will not get value

         

        refer

        Why Time Intelligence Fails - Power bi 5 Savior Steps for TI: https://youtu.be/OBf0rjpp5Hw