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
kennyyip
Helper I
Helper I

Remove future date in totalytd or datesytd

Hi,

 

I have a formula below calculating YTD run-rate which is YTD revenue over YTD budget.

 

YTD Run-rate = if(lastdate(T_Revenue[Revenue_Date])<=date(2018,3,31),
                   divide(totalytd(sum(T_Revenue[Revenue_Actual]),T_Revenue[Revenue_Date].[Date]),
                          totalytd(sum(T_Revenue[Revenue_budget]),T_Revenue[Revenue_Date].[Date])),
                  blank())

 

My data set is from 2017 till 31/3. However, the measure calculates values for 4/2018 till end of 2018, locked the value as of YTD 31/3/2018.  So i tried to use IF and LASTDATE to remove the value of future date but in vain. I've tried both DATESYTD and TOTALYTD, or change the condition to max(T_Revenue[Revenue_Date])<=date(2018,3,31)...all are unsuccessful. I checked the old post but seems no solution works. Please help. Thanks a lot.

 

Line chart belows show the value of YTD Run-rate...the flat part is the future value i want to remove. Bar chart is the monthly revenue

Untitled.jpg

 

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @kennyyip

 

You can try this:

 

=
IF ( NOT ( ISBLANK ( [Revenue Measure] ) ), YTD Measure Formula )









Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

3 REPLIES 3
danextian
Super User
Super User

Hi @kennyyip

 

You can try this:

 

=
IF ( NOT ( ISBLANK ( [Revenue Measure] ) ), YTD Measure Formula )









Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Hi @danextian

 

My revenue is just a column of data points so ISBLANK does not work, any alternatives? Sorry I am relatively new to power BI.

 

Regards,

Kenny

Problem solved. Sorry for asking stupid question

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.