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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
vijay273162
Helper III
Helper III

SAMEPERIODLASTYEAR based on Running Days

Hi All,

Refer the below Simplified example.

vijay273162_0-1652770931079.png

 

 

So, I need to go back to PREVIOUS YEAR SAME QUARTER and based on Running day number, need to get the Total Sales value.

 

If I use SAME PERIODLAST YEAR, it only takes "total sales" for that date, this will not consider the logic of summing Weekend data ith Monday.

 

Please tell me, how to use Running Day number columns to get previous year "Total sales" data

3 REPLIES 3
vijay273162
Helper III
Helper III

HI Amit,

 

Not to compare Weekday of CY with Weekday of PY.

But, to compare, Running days no. of Current year with Running Day no. of Previous year.

 

Running Day no. is calculated as you said earlier using DAX CODE.

 

DESC - Running days_Quarter_(Excl_Wknd) =
COUNTROWS(
FILTER(
ADDCOLUMNS(CALENDAR(Period[Date],Period[End date of Quarter]),
"WorkDay", if(WEEKDAY([Date],2) <6,1,0)),
[WorkDay] =1)
)
)
 
So, it will exlcude Weekends while counting running days in Quarter.
Anonymous
Not applicable

Hi @vijay273162 ,

 

I can see "PY" and "CY" in your screenshot, are they from same table or from two different tables. I know they have the same format. If they are from two tables, I suggest you to combine them into one table in Power Query Editor.

For reference: Append queries

Could you share a sample file with me and show me the result you want? This will make it easier for me to find the solution.

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

amitchandak
Super User
Super User

@vijay273162 , Not very clear, Do you want to compare Week day of this with same weeikday last year ?

that will like

week Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-364,DAY))

 

 

Or do want work across work days

Traveling Across Workdays - What is next/previous Working day
https://community.powerbi.com/t5/Community-Blog/Travelling-Across-Workdays-Decoding-Date-and-Calenda...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.