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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Tenairen
New Member

Metric Calculation Adding Holiday & Weekend Metrics to Last business day Counts

Good afternoon!

 

I have been playing with this for a bit, and am not having any luck so maybe i am overlooking something!

 

I have two tables configured, one is a date table (TableOfDates):

DateDayOfWeekMonthYearFiscalQuarterFiscalYearBusinessDay
Dec 29, 2023FridayDecember2023Q32023/24Yes
Dec 30, 2023SaturdayDecember2023Q32023/24

No

Dec 31, 2023SundayDecember

2023

Q32023/24No
Jan 1, 2024MondayJanuary2024Q42023/24No

Jan 2, 2024

TuesdayJanuary2024Q42023/24Yes
Jan 3, 2024WednesdayJanuary2024Q42023/24Yes
Jan 4, 2024ThursdayJanuary2024Q42023/24Yes
Jan 5, 2024FridayJanuary2024Q42023/24Yes
Jan 6, 2024SaturdayJanuary2024Q42023/24

No

Jan 7, 2024SundayJanuary2024Q42023/24No
Jan 8, 2024MondayJanuary2024Q42023/24Yes
Jan 9, 2024TuesdayJanuary2024Q42023/24Yes

 

The other Defines our incoming Calls by IDs (Calls)

CallIDDateContact TypeIssue IDSub-Issue IDStatus
014562Dec 29, 2023New Call106In Progress

014563

Dec 29, 2023Update52New
014564Dec 29, 2023

Update

42

Pending Assessment

014565Dec 30, 2023New Call102In Progress
014566Dec 30, 2023New Call82Complete
014567Dec 31, 2023 Update31In Progress
014568Dec 31, 2023New Call11Pending Assessment
014569

Jan 1, 2024

New Call12New
014570Jan 1, 2024 Update33

Pending Assessment

014571Jan 2, 2024New Call103In Progress
014572Jan 2, 2024New Call103Complete
014573Jan 3, 2024New Call64Complete
014574Jan 3, 2024 Update65Complete
014575Jan 3, 2024New Call87In Progress
014576Jan 4, 2024New Call95New
014577Jan 4, 2024 Update54Complete
014578Jan 4, 2024New Call103New
014579Jan 5, 2024 Update22Complete
014580Jan 6, 2024New Call11New
014581Jan 8, 2024Update15In Progress

 

What i need to do is create a count of volume on a given date however, whoever created the metric originally has included any volumn on a weekend date or holiday date in the last business day -- So above for example Dec 30, 31 & Jan 1 counts should be included within Dec 29.... 

 

I have been able to create a measure which workes well to include the volumn on a weekend day in the leading Friday total: 

zVolCounter(RemoveSat/Sun) =
VAR _VolCounterNOSatSun = Count('Calls'[ID]) RETURN
IF
    HASONEVALUE('TableOfDates'[Date]),
    SUMX(
        Values('TableOfDates'[Date]),
        IF(
            Weekday('TableOfDates'[Date]) = 6
            _VolCounterNOSatSun 
            +CALCULATE
                COUNT('Calls'[ID]),
                NEXTDAY('TableOfDates'[Date])
            )
            +CALCULATE
                COUNT('Calls'[ID]),
                NEXTDAY(NEXTDAY('TableOfDates'[Date]))
            ),
            IF(WEEKDAY('TableOfDates'[Date]) IN {1,7},Blank(),_VolCounterNOSatSun
        )
    ), _VolCounterNOSatSun
)

 

So far I have not been able to figure out how to do this with the Business day field to add my holidays count to the previous business day count.  Any help at all would be highly appriciated (I am not using slicers or filters... I just need a overall count daily)

1 ACCEPTED SOLUTION
ThxAlot
Super User
Super User

Easy enough, create a calculated column for the start date of each bucket,

ThxAlot_0-1721079793753.png

 

of coz, the logic can be implemented on the fly by a measure,

Bucket_Start = 
VAR __dt =
    MAX( DATES[Date] )
RETURN
    CALCULATE(
        MAX( DATES[Date] ),
        DATES[Date] <= __dt,
        DATES[BusinessDay] = "Yes"
    )

 

ThxAlot_1-1721080009449.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



View solution in original post

2 REPLIES 2
ThxAlot
Super User
Super User

Easy enough, create a calculated column for the start date of each bucket,

ThxAlot_0-1721079793753.png

 

of coz, the logic can be implemented on the fly by a measure,

Bucket_Start = 
VAR __dt =
    MAX( DATES[Date] )
RETURN
    CALCULATE(
        MAX( DATES[Date] ),
        DATES[Date] <= __dt,
        DATES[BusinessDay] = "Yes"
    )

 

ThxAlot_1-1721080009449.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



Sorry guys, i ended up in the sick and away for a bit,  this solution solves the issue of getting into the date buckets vs by date. I am seeing some duplication in the dates when quantifying the number of calls... the assumption i am having is because i am using the date bucket vs the date ? 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.