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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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

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.