Forum Discussion

GSPBI's avatar
GSPBI
Frequent Visitor
4 years ago
Solved

Calculated Column - Show Last Week's Data in Current Week

Dear Microsoft PowerBI community,   I have been a long time user of this forum and I really appreciate all the users that raised their queries and the those that respond to them. I have come acr...
  • Russell-PBI's avatar
    4 years ago

    Hi GSPBI, this seems to work:

    No. Activities Planned = 
    VAR PublicationNumber = 'Table'[Publication Number]
    VAR PreviousPublicationNumber =
    CALCULATE(
    Max('Table'[Publication Number])
    , ALLEXCEPT('Table','Table'[Id])
    , ('Table'[Publication Number] < PublicationNumber)
    )
    RETURN
    CALCULATE(
    MAX('Table'[Planned])
    , ALLEXCEPT('Table', 'Table'[Id])
    , 'Table'[Publication Number] = PreviousPublicationNumber
    )