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
paris
Helper V
Helper V

Divide price into historical and forecast by date

Hi All,

 

Thank you for your help as always. 

Price on my price table contains both historical and forecast. I want to divide them into two columns by month/year.

 

For example, today is 14 Mar 2020.  

Data till end of Mar 2020 = Historical column 

Data from Apr 2020 = Forecast column 

 

2020_03_14_historical.JPG

Apprecaite if you can help!

 

All the best,

Paris

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@paris ,

Try New columns in the price table

 

Historical =
var _Max = EOmonth(today(),0)
return
if([date]<=_Max ,[Price],blank())

forecast =
var _Max = EOmonth(today(),0)
return
if([date]>_Max ,[Price],blank())

 

 


Appreciate your Kudos.

 

 

 

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@paris ,

Try New columns in the price table

 

Historical =
var _Max = EOmonth(today(),0)
return
if([date]<=_Max ,[Price],blank())

forecast =
var _Max = EOmonth(today(),0)
return
if([date]>_Max ,[Price],blank())

 

 


Appreciate your Kudos.

 

 

 

Hello Amitchandak,

 

Thank you very much for your help. It seems I need to add ,0 after today().

 

Otherwise, it works perfectly. Thank you again. 

 

EOMONTH(today(),0)

 

All the best,

Paris

 

@paris , Thanks for pointing out. Corrected the post for anyone who looks for a similar solution. Kudos !!

 

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.