Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Value from previous row grouping within groups

Dear Community, pelease help   New but eager to learn Power BI:-)   I am strugling with finding a solution that gives me previous Date/row value and also grouping it by the key/items This it to h...
  • amitchandak's avatar
    5 years ago

    Anonymous ,

    You can get

    previous Date = coalesce(maxx(filter(Table,[Item] =earlier([Item]) && [Country] =earlier([Country]) && [ChangeDate] <earlier([ChangeDate]) ),[ChangeDate]),[ChangeDate])

     

    Date diff = ( [ChangeDate] ,[previous Date],Day)

     

    For the business days you need to use calendar . refer

    https://www.sqlbi.com/articles/counting-working-days-in-dax/