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
Anonymous
Not applicable

Create a Calculated Column to Sum Weekend Values

I have a date table that has calculated column counting all requests submitted on a given day.

There are two KPIs that need to be tracked.  The first KPI is that each weekday has a capacity for 10 new requests.

This I can track quite easily.

 

The other KPI is that wekends have a capacity of 5 new requests in total over the weekend.

How can I create a column that sums the number of requests made on a Saturday and Sunday of each week?

 

My table currently looks like this:

HMJSomerset_0-1668525697140.png

I want a column that sums 20/08 & 21/08 and places the value in 21/08 so that I can display it as a time series visual

e.g.

Date        Weekend Requests

21/08/22             8

28/08/22             6 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I think I have the answer.  I used a variable to get teh value of the previous row...

Weekend Requests =
var PrevDay = CALCULATE(
    SUM('Calendar'[Date on D2A]),
    DATEADD('Calendar'[Date],-1,DAY)
)
return
IF('Calendar'[DayOfWeekNumber] = 7,
'Calendar'[Date on D2A] + PrevDay
)

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

I think I have the answer.  I used a variable to get teh value of the previous row...

Weekend Requests =
var PrevDay = CALCULATE(
    SUM('Calendar'[Date on D2A]),
    DATEADD('Calendar'[Date],-1,DAY)
)
return
IF('Calendar'[DayOfWeekNumber] = 7,
'Calendar'[Date on D2A] + PrevDay
)

 

Anonymous
Not applicable

@Shaurya 

 

Thanks for the reply.  This goes part way.  The total is placed in Day 7 but the final sum places the total for the whole column in the cell and not just the total of the 2 days of that week's day 6&7.

Shaurya
Memorable Member
Memorable Member

Hi @Anonymous,

 

You can use:

 

Weekend Requests = IF(DayOfWeekNumber=7, IF(DayOfWeekNumber=6 || DayOfWeekNumber=7, SUM('Table'[Requests])))

 

Works for you? Mark this post as a solution if it does!
Check out this blog of mine: How to Export Telemetry Data from Azure IoT Central into Power BI

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.