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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
mdatmain
Regular Visitor

Create a measure that returns existing values before TODAY() and forecasted values after TODAY()

I have a column sales total per day from the start of the year until now (4/22/2021). Then I have projected sales all year from beginning to end (Jan 1 -> Dec 31).

 

I want to create a new column or measure which is a combination of both of these columns, where all the values before today are the actual daily sales, and all the values after today are projected daily sales, so I can plot the projected cumulative sales forecast. I just am very new to DAX and have no idea how to implement it here.

 

I would think to get the before today values with DATESINPERIOD(MIN('Table'[Date]), TODAY()), and projected values after today with DATESINPERIOD(TODAY(), MAX('Table'[Date]). But not sure how to combine. 

 


YTD PROJECTION = 
VAR NeedHelpWithMeasure = ???

 

RETURN CALCULATE(
    SUM(NeedHelpWithMeasure),
    DATESYTD( 'Table'[Date])

)

 

mdatmain_0-1619110063845.png

 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi, @mdatmain 

Please check the below picture and the sample pbix file's link down below.

I create a sample that hopefully suits your requirement.

All measures are in the sample pbix file, and all steps are numbered in front of each measure.

 

Picture1.png

 

https://www.dropbox.com/s/0h784sgfpiznyyc/mdatmain.pbix?dl=0 

 

 

Hi, My name is Jihwan Kim.

 

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

 

Linkedin: https://www.linkedin.com/in/jihwankim1975/

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

View solution in original post

1 REPLY 1
Jihwan_Kim
Super User
Super User

Hi, @mdatmain 

Please check the below picture and the sample pbix file's link down below.

I create a sample that hopefully suits your requirement.

All measures are in the sample pbix file, and all steps are numbered in front of each measure.

 

Picture1.png

 

https://www.dropbox.com/s/0h784sgfpiznyyc/mdatmain.pbix?dl=0 

 

 

Hi, My name is Jihwan Kim.

 

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

 

Linkedin: https://www.linkedin.com/in/jihwankim1975/

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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