cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MdB
Frequent Visitor

Measure Calculate until last week

I'm trying to get a measure right. 

 

Certain grades are given and I want to see how they progress every week. For that I try to write a measure that has the average of the grade number and filters until the last week.

 

Unfortunately I cannot get a dynamic week date where the measure has the current week minus 1 (so that it shows the average until last week). Hope someone can help out. 

 

test =

calculate(AVERAGE(table[number]),WEEKNUM('Calendar'[Date])-1)
1 ACCEPTED SOLUTION
jppv20
Solution Sage
Solution Sage

Hi @MdB ,

 

First, create a weeknumber column in your calendar table:

WeekNumber = WEEKNUM('Calendar'[Date],2)
 
Then create a measure like this:
test =
var Maxdate = WEEKNUM(TODAY(),2)-1
return
CALCULATE(AVERAGE('Table'[Number]),'Calendar'[WeekNumber]<=Maxdate)
 
If I answered your question, please mark it as a solution to help other members find it more quickly.

View solution in original post

1 REPLY 1
jppv20
Solution Sage
Solution Sage

Hi @MdB ,

 

First, create a weeknumber column in your calendar table:

WeekNumber = WEEKNUM('Calendar'[Date],2)
 
Then create a measure like this:
test =
var Maxdate = WEEKNUM(TODAY(),2)-1
return
CALCULATE(AVERAGE('Table'[Number]),'Calendar'[WeekNumber]<=Maxdate)
 
If I answered your question, please mark it as a solution to help other members find it more quickly.

Helpful resources

Announcements
Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Power BI Release May 2022 768x460.png

Check it out!

Click here to read more about the May 2022 updates!