Power BI Exchange

Please login or click SIGN UP FOR FREE to create your PowerBIUG account to join this user group.
 View Only
  • 1.  Simple question on PREVIOUSMONTH?

    Posted Nov 23, 2022 11:19 AM
    Just trying to use PREVIOUSMONTH function but I always get blanks. I am using Auto Time Intelligence and my column is set to type of Date and I see the Date Hierarchy.

    Measure = LASTDATE(Divs[Date].[Date]) works as expected but
    Measure = PREVIOUSMONTH(Divs[Date].[Date]) returns Blank

    No filters, no slicer, nothing obvious to me.

    I am actually trying to do the following, but cannot get PREVIOUSMONTH to work
    Last Month = CALCULATE(SUM(Divs[Amount]),PREVIOUSMONTH(Divs[Date].[Date]))


    Thanks in advance. 

    Joseph Palumbo

  • 2.  RE: Simple question on PREVIOUSMONTH?

    Posted Nov 23, 2022 08:22 PM
    Edited by Vilmar Santos Nov 23, 2022 08:24 PM

    Creio que seja porque está usando a data de sua tabela fato

    Tente criar uma tabela de calendário e faça o relacionamento
    dCalendar = CALENDARAUTO()​

    Incluir na fórmula
    Last Month = 
    CALCULATE ( [Qtde], PREVIOUSMONTH ( dCalendar[Date] ) )​

    Vilmar Santos