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.
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:
ID | startdate | enddate | value |
1 | 03/01/2015 | 05/01/2015 | 5 |
2 | 02/01/2015 | 10/01/2015 | 10 |
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!
Solved! Go to Solution.
Refer to my blog to check how to deal with two dates and get in between range
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
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] )
)
)
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?
Refer to my blog to check how to deal with two dates and get in between range
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
94 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |