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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.