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

Distribute a specific value over a period of time

Hi there,

 

I have a table in Power BI Desktop with a start date and an end date. I have already calculated a value which should be distributed over this period of time.

 

So, for instance, if a project starts at 03/01/15 and ends at 05/01/15, the value should be displayed from March to May. 

 

In Excel, I have used the following formula so far:

 

= IF (AND([datevalue] >= [beginvalue];[datevalue]<=[endvalue)];[calculatedvalue];0)

 

However, I am not able to do the same thing in Power BI Desktop. Any ideas how I can accomplish that? Thank you in advance 🙂

 

 

 

Edit:

 

IDstartdateenddatevalue
103/01/201505/01/20155
202/01/201510/01/201510

 

Some further information about what I want to accomplish: I want to display the values 5 or 10 in the period between February and October 2015 (10 in February, 15 in March, 15 in April, etc.).

 

Thank you for your help guys!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

Refer to my blog to check how to deal with two dates and get in between range

: https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Connect on Linkedin

View solution in original post

3 REPLIES 3
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Create a date table

then create a measure

Measure =
CALCULATE (
    SUM ( 'Table'[value] ),
    FILTER (
        'Table',
        'Table'[startdate]
            <= MAX ( 'date table'[Date] )
            && 'Table'[enddate]
                >= MAX ( 'date table'[Date] )
    )
)

Capture1.JPG

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

@v-juanli-msft I am doing something similar and I used your method and it worked. Now, what if I need to get cumulative values as well?

amitchandak
Super User
Super User

Refer to my blog to check how to deal with two dates and get in between range

: https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Connect on Linkedin

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.