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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
mh2587
Super User
Super User

Calculate measure value same day of few last weeks

Hi

I hope you all doing well

I have scenario in we have to calculte the of same day and last week same day ( the case will be multiple same days)

E.g let suppose today is Monday and Previouse same day will be Monday and so on 

on Same days filter I am calculating measure values
14-03-2022 = Monday

07-03-2022 = Monday

28-02-2022 = Monday and So on

Thanks Advance for helping

 


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



1 ACCEPTED SOLUTION

I have still the issue but I am going to close this thread 


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



View solution in original post

3 REPLIES 3
v-yanjiang-msft
Community Support
Community Support

Hi @mh2587 ,

Has your problem been solved? If yes, please consider accept it as the solutionto help the other members find it more quickly. 

If not, do you want to get dates of the same weekday within few last weeks, or anything else. Can you give an example?

Best Regards,
Community Support Team _ kalyj

I have still the issue but I am going to close this thread 


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



rsbin
Super User
Super User

@mh2587,

If I understand your question correctly, I perform this same measure.

Please review the code below.  You can modify per your exact requirements.

When I was first doing this, the key was identifying and using the Weekday function.

LiftWorkOrders_SameDay_4WkAvg = 
VAR _LastDate = TODAY() - 1
VAR _Weekday = WEEKDAY( _LastDate )
VAR _Duration = 3           // Prior 3 Weekdays + LastDate gives 4 Periods
VAR _FirstDate = _LastDate - _Duration*7
VAR _CalculationPeriod = // Isolate the 4 Prior Weekdays
                                FILTER( ALL ( DIM_Date ),
                                  AND( AND (DIM_Date[Date] >= _FirstDate,
                                       DIM_Date[Date] <= _LastDate ),
                                       WEEKDAY(DIM_Date[Date]) = _Weekday ))

VAR _MovingAverage = CALCULATE (AVERAGEX( DIM_Date,[LiftWorkOrders]), _CalculationPeriod )

RETURN
       _MovingAverage

 Hope this works for you.

Good Luck and Regards,

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors