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
wenners68
Helper II
Helper II

calculate revenue for current week

Hi,

 

I'm trying to find an example of how to sum total sales for the current week.

My dataset includes a date field for each transaction in the format 22/10/2017.

 

Any ideas?

 

2 ACCEPTED SOLUTIONS
v-yuezhe-msft
Employee
Employee

@wenners68,

Create a column using the DAX below in your table.

WeekNumber = WEEKNUM(Table[Date],2)

Then create a measure using the Dax below and check if you get expected result.

SalesforCurrentWeek= CALCULATE(SUM(Table[sale]),FILTER(Table,YEAR(Table[Date])=YEAR(NOW())&&WEEKNUM(NOW())=Table[WeekNumber]))



Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yuezhe-msft
Employee
Employee

@wenners68,

Create a column using the DAX below in your table.

WeekNumber = WEEKNUM(Table[Date],2)

Then create a measure using the Dax below and check if you get expected result.

SalesforCurrentWeek= CALCULATE(SUM(Table[sale]),FILTER(Table,YEAR(Table[Date])=YEAR(NOW())&&WEEKNUM(NOW())=Table[WeekNumber]))



Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

I used this same calculation for counting the number of dates, however, when adding to the table visual, it shows the same count across all jobs.

 

Is there a way to have each line calculate by job?

Thanks!

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.