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
DonnaC
Frequent Visitor

How to compare different products sales in different date?

Hi All,

I want to compare different products sales. Those products were launched on different dates, so they have different first sale month, second, third and so on, just like that sample showing in the table below. Now I want to compare different productions' first, second until the last month sales in line chart, similar with the chart below. How could I create procedure with DAX in Power BI?

Thanks!

Donna

table.JPGChart.png

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@DonnaC , You can create a new columns

first sales date = minx(filter(table, [product] =earlier([product])), [sales Date])
month since first sales = datediff([first sales date],[sales Date],month)

 

 

also refer: https://www.youtube.com/watch?v=Q1vPWmfI25o

View solution in original post

2 REPLIES 2
DonnaC
Frequent Visitor

@amitchandakThanks Amit, the youtube video is very helpful!

amitchandak
Super User
Super User

@DonnaC , You can create a new columns

first sales date = minx(filter(table, [product] =earlier([product])), [sales Date])
month since first sales = datediff([first sales date],[sales Date],month)

 

 

also refer: https://www.youtube.com/watch?v=Q1vPWmfI25o

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.