Forum Discussion

NarenderMakhija's avatar
NarenderMakhija
New Member
3 years ago

Weekly collection in dax

Hi All,

 

I have to show weekly amount in report.

I have daily sales amount tax centre wise in my power query table. I have date, day, month, weekno, year in my calender.

 

I have filters day,month, year in Dashboard.

If user does not select any filter then report should show the current week collection.

if user select  year, month & day filter then report should show the weekly amount , according to the week from selected fields filters (day,month,year).

 

week no in my calender = Date.WeekOfYear(date)

 

Report Output: 

 

Tax Center                    Weekly Collection

Tax centre 1                  Current week amount by default otherwise amount based on selection in calender (year,month,day)

 

Please help to get the weekly dax expression.

 

Thanks & Regards

Narender

2 Replies

    • NarenderMakhija's avatar
      NarenderMakhija
      New Member

      Thanks Abbas.

       

      I dont have week num filter in my dashboard.

       

      i used the weeknum function and get the amount of current week.

       

      Measure Week = IF(ISBLANK(SELECTEDVALUE('Calendar'[Year])),CALCULATE(SUM(table1[tax.AMOUNT]),'Calendar'[Year]= YEAR(TODAY()), WEEKNUM('Calendar'[Dates])=WEEKNUM(TODAY()), ALL('Calendar')),CALCULATE(SUM(table1[tax.AMOUNT]),WEEKNUM('Calendar'[Dates])=WEEKNUM(TODAY()-1),ALL('Calendar'[Day])))
       

      But i need to get the amount of week based on user selection (year,month,day) when user select any previous year/month/day from filters.

       

      Thanks,
      Narender