Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
NarenderMakhija
New Member

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 2
AbbasG
Memorable Member
Memorable 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

 

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.