Forum Discussion

gpiero's avatar
gpiero
Skilled Sharer
9 years ago
Solved

creating a summury table from existing PBD table

I have created a report that summarize values for each storage location using data come from ERP every week. Thanks to previous advices I have got in this forum it works properly.   But now the Co...
  • Anonymous's avatar
    Anonymous
    9 years ago

    Hi gpiero,

     

    Based on your description, you want to get the weekly summary of your records, right?

    You can refer to below formula to get weekly summary data(weeknum function):

     

    Base table:
     

     

    Measures:

    WeekNumber = WEEKNUM(MAX('Table'[Date]))

     

    Weekly Summary =
    var currDate=MAX('Table'[Date])
    var CurrWeekNo=WEEKNUM(MAX('Table'[Date]))
    return
    SUMX(FILTER(ALL('Table'),AND(WEEKNUM('Table'[Date])=CurrWeekNo,YEAR([Date])=YEAR(currDate))),'Table'[Amount])

     

     

    Regards,
    Xiaoxin Sheng