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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
spitfyah
Frequent Visitor

Break a monthly figure into a daily figure

Hi all,

 

I currently have a target table as this:

 

ClientStart DateEnd DateTarget 1Target 2Target 3
Client 101-Jan-2231-Jan-22223709343
Client 201-Jan-2231-Jan-2267446747
Client 301-Jan-2231-Jan-22264379561
Client 101-Feb-2228-Feb-2211822881
Client 201-Feb-2228-Feb-22607495356
Client 301-Feb-2228-Feb-223336115
Client 101-Mar-2231-Mar-22447859100
Client 201-Mar-2231-Mar-2273656684
Client 301-Mar-2231-Mar-22216619663
Client 101-Apr-2230-Apr-22309666331
Client 201-Apr-2230-Apr-22217555143
Client 301-Apr-2230-Apr-22870280130
Client 101-May-2231-May-22651820610
Client 201-May-2231-May-22899622835
Client 301-May-2231-May-22895651873

 

I wanted to make a matrix that would show something like this

 

 MTD Target CTD TargetRolling 3M Target
Client 142012941213.929
Client 258021401728.107
Client 3577.41935481996.4191770.455

 

 

MTD Target would be for the 1st 20 days of may, target figure/(days in month)*days elapsed in month

CTD Target is everything from February 1st onwards as that's when the contract starts

Rolling 3M Target would be the target for the last 90 days (so from Feb 20 to May 20)

 

I only have the monthly figures so was hoping to get a measure that would split the monthly figure out via the days present in the month. If possible I would also like a generic target figure that would show the target based on the date filters I have applied in the slicers.

 

 

 

 

2 REPLIES 2
v-rongtiep-msft
Community Support
Community Support

Hi @spitfyah 

Please have a try.

MTD Target =
VAR _month =
    MONTH ( MAX ( 'Table'[Start Date] ) )
VAR _days =
    DAY ( EOMONTH ( MAX ( 'Table'[Start Date] ), 0 ) )
VAR _sum =
    CALCULATE (
        MAX ( 'Table'[Target 1] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[client] = SELECTEDVALUE ( 'Table'[client] )
                && 'Table'[Start Date] = SELECTEDVALUE ( 'Table'[Start Date] )
        )
    )
VAR _datt =
    DAY ( DATE ( 2022, 5, 20 ) )
RETURN
    _sum / _days * 20

vpollymsft_0-1653372289187.png

 

How to calculate the other columns?

 

Could you please provide more details?  The specific calculation of the formula. Like the MTD Target: sum target1 in May / days in each month * Number of days elapsed during the month

 

Best Regards

Community Support Team _ Polly

 

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

@spitfyah , refer if this can help

Distributing/Allocating the Monthly Target(Convert to Daily Target): Measure ( Daily/MTD): https://community.powerbi.com/t5/Community-Blog/Power-BI-Distributing-Allocating-the-Monthly-Target-...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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