Forum Discussion

rcister's avatar
rcister
Frequent Visitor
5 years ago
Solved

undefined

Hello everyone! I have a question about a mesuare. Im trying to make a recount according the month.

As you can see, the present month is ok, but when I try to see the following month, the result is wrong( eg in the column that it said "MARZO " in Recount next month it should appear number 16, that correspond to April.

Best Regards!

  • rcister's avatar
    rcister
    5 years ago

    I could fix it!

    Thank you very much in any way

    Best Regards!

     

6 Replies

  • AllisonKennedy's avatar
    AllisonKennedy
    Community Champion

    rcister 

     

    Make sure you have your Calendar table 'Mark as Date table' see the bottom of this blog for how to: 

    https://excelwithallison.blogspot.com/2020/04/dimdate-what-why-and-how.html

     

    Also, then you can update the Recount Next Month measure to:

     

    Recount Next Month = CALCULATE( [Recount Present Month], DATEADD(Calendar[Date], 1, MONTH))

     

    That pattern of CALCULATE( [Measure], DATEADD(Calendar[Date], #, MONTH)) will always work. You can even switch DATEADD for other time intelligence measures and MONTH for other YEAR, etc.

    • rcister's avatar
      rcister
      Frequent Visitor
      Dear Allison, thank you for you answer... Unfortunately, this measure dont work :(... I used your calendar but the measure for the next month that it gave is exactly the same as the present month...
      this is the mesuare for the present month:
      Recount Present Month = SUMX (FILTER (dot, dot [Overnight date]), dot [Count])
      The table dot has the following form:
       
      Reservation number      type of room        overnight night         Count (count by reservation number and room type)
      899                                    single                       4/4/2021                   1
      899                                    junior                       4/4/2021                   1
       
      Best Regards!