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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
msmith
Regular Visitor

Daily apportionment of weekly target based on historical trends

I manually set and input a weekly income target for our team. I have a measure set up which allows me to use a gauge visual to demonstrate to the team their cumulative progress towards the target over the course of the week.

 

What I would like to do however, is to make a daily apportionment of the weekly target that I have set, so that I can use a Line Chart to show them if they are ahead of or behind the target on a daily basis.

 

The daily apportionment of the weekly target should be based on historical trends of what proportion of the overall weekly income has been generated on a daily basis. (It wouldn’t work to just split the weekly target figure down equally across the weekdays as we have some very clear peak days in the week).

 

Happy to share any information that might be required to get some assistance…far beyond my capability level at the minute!

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@msmith 

 

You may try measure below to calculate the percentage.

Measure =
VAR d =
    SELECTEDVALUE ( 'Calendar'[Date] )
VAR w = 10
RETURN
    DIVIDE (
        CALCULATE (
            SUM ( 'Table'[Value] ),
            DATEDIFF ( 'Table'[Date], d, WEEK ) >= 1
                && DATEDIFF ( 'Table'[Date], d, WEEK ) <= w,
            'Table'[Weekday] = WEEKDAY ( d )
        ),
        CALCULATE (
            SUM ( 'Table'[Value] ),
            DATEDIFF ( 'Table'[Date], d, WEEK ) >= 1
                && DATEDIFF ( 'Table'[Date], d, WEEK ) <= w
        )
    )

 

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-chuncz-msft
Community Support
Community Support

@msmith 

 

You may try measure below to calculate the percentage.

Measure =
VAR d =
    SELECTEDVALUE ( 'Calendar'[Date] )
VAR w = 10
RETURN
    DIVIDE (
        CALCULATE (
            SUM ( 'Table'[Value] ),
            DATEDIFF ( 'Table'[Date], d, WEEK ) >= 1
                && DATEDIFF ( 'Table'[Date], d, WEEK ) <= w,
            'Table'[Weekday] = WEEKDAY ( d )
        ),
        CALCULATE (
            SUM ( 'Table'[Value] ),
            DATEDIFF ( 'Table'[Date], d, WEEK ) >= 1
                && DATEDIFF ( 'Table'[Date], d, WEEK ) <= w
        )
    )

 

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.