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
Sampath_Santosh
Regular Visitor

Evolution of the product based on launch date

Hi everyone,
Hope you are doing great.

I have a challenge and want your help.

Here is the sample data.
Product is product name 
Country is country name 
Month is sales for the month
Sales is Amount of Sales 
Launch date is when the product is launced in the market 

ProductCountryMonthSalesLaunch Date
Product xGermany01-09-202310301-03-2021
Product xFrance01-01-202165801-01-2021
Product xGermany01-02-202136301-03-2021
Product xFrance01-03-202158501-01-2021
Product xGermany01-04-202190801-03-2021
Product xFrance01-05-202118301-01-2021
Product xGermany01-06-202124701-03-2021
Product xFrance01-07-202124001-01-2021
Product xGermany01-08-202121601-03-2021
Product xFrance01-09-202168501-01-2021
Product xGermany01-10-202159001-03-2021
Product xFrance01-11-202150701-01-2021
Product xGermany01-12-202184701-03-2021
Product xFrance01-01-202241801-01-2021
Product xGermany01-02-202239601-03-2021
Product xFrance01-03-202212901-01-2021
Product xGermany01-04-202228201-03-2021
Product xFrance01-05-202229401-01-2021
Product xGermany01-06-202213001-03-2021
Product xFrance01-07-202271601-01-2021
Product xGermany01-08-202294201-03-2021
Product xFrance01-09-202231801-01-2021
Product xGermany01-10-202286601-03-2021
Product xFrance01-11-202226601-01-2021
Product xGermany01-12-202243201-03-2021
Product xFrance01-01-202385701-01-2021
Product xGermany01-02-202370301-03-2021
Product xFrance01-03-202320001-01-2021
Product xGermany01-04-202338201-03-2021
Product xFrance01-05-202323201-01-2021
Product xFrance01-06-202315001-01-2021
Product xGermany01-03-202185501-03-2021
Product xFrance01-04-202129701-01-2021
Product xFrance01-05-202192801-01-2021


The challenge is I need to show the evolution of product for the last 10 months 
(Evolution : Trend of the product since the launch)

Evolution of product.png
The 1st challenge is :
X axis should have numbers (0,1,2,3,4,5,6,7,8,9,10) - (months completed since launch) where 0 will be 0 sales every time 
Eg : Product X launced in france on "01-01-2021" and sale for the month is 658 , This value should show on 1 of my line chart , while 0 should be always 0.

And second challenge is, on selecting particular month in slicer , i need to show last 10 months sale trend of the products  launched in that last 10 months (Evolution).

Thanks in advance 🙂 

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi @Sampath_Santosh ,

I created a sample pbix file(see the attachment), please check if that is what you want.

1. Create a number dimension table

Months completed since launch = GENERATESERIES(0, 10, 1)

vyiruanmsft_1-1680231248924.png

2. Create a measure as below to get the sales for last 10 months after launch

Sales for 10 months after launch = 
VAR _sellaunchdate =
    SELECTEDVALUE ( 'Table'[Launch Date] )
VAR _selmonths =
    SELECTEDVALUE ( 'Months completed since launch'[Value] )
RETURN
    IF (
        _selmonths = 0,
        0,
        CALCULATE (
            SUM ( 'Table'[Sales] ),
            FILTER (
                'Table',
                DATEDIFF ( _sellaunchdate, 'Table'[Month], MONTH ) = _selmonths - 1
            )
        )
    )

3. Create a line chart visual

vyiruanmsft_0-1680231190681.png

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Sampath_Santosh
Regular Visitor

Hi Rena,
Thank you so much for taking time and helping me.
Here i may be more clear , its my fault .
The second challenge was , on selecting a (single selection) month (sales month - Eg:01-09-2023) , I need to consider, in the last 10 months ( 01-12-2022 to 01-09-2023 ) which are the products have been launched and thier trend/Evolution. 
Eg Product X launched on 01-09-2023 , so i should consider this product in my line chart .
product Y launched on 01-10-2022 , I should not consider this product in my line chart .
Similarly Product Z launched on 01-10-2023 , I should not consider this product in my line chart.

Can you please help me in this case ?
Thank you once again for your support.

Hi @Sampath_Santosh ,

I'm a little confused. Could you please provide some specific examples to explain your requirement based on your shared sample data? For example: when select 01-09-2023, which values you want to display on the line chart? The last 10 months ( 01-12-2022 to 01-09-2023 ) is for [launch data] or [Month] field? Thank you.

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi,
I am just modifying the logic for 5 months instead of 10 months for explination.
Here is sample data with less data and caluclations done in Excel for reference.
----------------------------------------------------Data--------------------------------------

ProductSales for the MonthSalesLaunch DateDiff In months from Launch+1 Month 
Product X01-Dec-2250101-Dec-2201
Product X01-Jan-2341501-Dec-2212
Product X01-Feb-2330901-Dec-2223
Product X01-Mar-2317401-Dec-2234
Product Y01-Jan-2394401-Jan-2301
Product Y01-Feb-2323201-Jan-2312
Product Y01-Mar-2345901-Jan-2323
Product Z01-Oct-2210001-Oct-2201
Product Z01-Nov-2211501-Oct-2212
Product Z01-Dec-2299401-Oct-2223
Product Z01-Jan-2368601-Oct-2234
Product Z01-Feb-2344201-Oct-2245
Product Z01-Mar-2360001-Oct-2256

 

+ 1 month column is done for if 0 is there we should always show 0
------------------------------------------------------------------------------------------------
Condition : 
On selecting a sale for the month of Mar-23 , Eligible products to be shown are : Sale month - 5 months range (Nov'22, Dec'22, Jan'23 , Feb'23,Mar'23).
Here Product X & Y launch dates fall in the range of Nov'22 to Mar'23 so these products to be considerd.
Product Z is launched in Oct'22 so we should not consider that product.

Sampath_Santosh_1-1680249562369.pngSampath_Santosh_2-1680249608046.pngSampath_Santosh_3-1680249626078.png

So abobe result is what we need to see in Power BI.
Thank you .
Please let me know if still any quires, i am happy to explain again.
Thanks 🙂 

v-yiruan-msft
Community Support
Community Support

Hi @Sampath_Santosh ,

I created a sample pbix file(see the attachment), please check if that is what you want.

1. Create a number dimension table

Months completed since launch = GENERATESERIES(0, 10, 1)

vyiruanmsft_1-1680231248924.png

2. Create a measure as below to get the sales for last 10 months after launch

Sales for 10 months after launch = 
VAR _sellaunchdate =
    SELECTEDVALUE ( 'Table'[Launch Date] )
VAR _selmonths =
    SELECTEDVALUE ( 'Months completed since launch'[Value] )
RETURN
    IF (
        _selmonths = 0,
        0,
        CALCULATE (
            SUM ( 'Table'[Sales] ),
            FILTER (
                'Table',
                DATEDIFF ( _sellaunchdate, 'Table'[Month], MONTH ) = _selmonths - 1
            )
        )
    )

3. Create a line chart visual

vyiruanmsft_0-1680231190681.png

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.