cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tamrerk_SRS Frequent Visitor
Frequent Visitor

Need help on creating the number of months from specific date report

Hi

I would like to create the report dashboard which has charts comparing the sales amount of 2 products by the number of months after launch.
I tried to create the new date table which contains the column of launch date and launch date +30 days(1 month after launch), +60 (2 month after launch),... for time dimension.
Pleae refer to the following code (have errors when I run with DAX Studio) and report screenshot.

 

MonthfromLaunch = 
ADDCOLUMNS (Datefromdef,
"LAUNCHDATE", DATE(2018,05,15),
"MonthBefore", DATESINPERIOD(vd_invoice[ShipingDay],DATE(2018,05,15),-30,day), 
"FirstMonth", DATESINPERIOD(vd_invoice[ShipingDay],DATE(2018,05,15),+30,day),
"SecondMonth", DATESINPERIOD(vd_invoice[ShipingDay],DATE(2018,05,15),+60,day)
)

referred_graph.png

 

Anyone has a better solution to create this kind of report?

P.S. The Launch Date is not fixed and will be per product, does Power BI have the function to input the date and use it as variable for the launch date?

 

Thank you in advance

 

2 REPLIES 2
EVEAdmin Member
Member

Re: Need help on creating the number of months from specific date report

Perhaps, you can create a measure to calculate the number of months between the product launch date and the invoice date:

 

NoOfMonths = DATEDIFF("2015-08-15",YourInvoiceDate,MONTH)
tamrerk_SRS Frequent Visitor
Frequent Visitor

Re: Need help on creating the number of months from specific date report

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

New Badges

Incoming: New and Improved Badges

Exciting news: We've given our badges an overhaul and added brand news ones.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 153 members 1,477 guests
Please welcome our newest community members: