Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi All,
Below is my sample data,
I need to find the immediate previous sales of each product using sales date. The last 'Previous Sales Amount' column is all i need to calculate as a calculated column. For ex: For Product 'A' and sales date '10-01-2020', Sales Amount 1000 is the immediate previous sales this Product.
Thanks in Advance....
Solved! Go to Solution.
@Anonymous ,
As a new column
New column =
var _max = maxx(filter(Table, [product] =earlier([product]) && [Sales date] < earlier([Sales date])),[Sales date])
return
maxx(filter(Table, [product] =earlier([product]) && [Sales date] =_max ),[Sales Amount])
As new measure with help from date table
Last Day Non Continuous = CALCULATE([sales],filter(ALLSELECTED('Date'),'Date'[Date] =MAXX(FILTER(ALLSELECTED('Date'),'Date'[Date]<max('Date'[Date])),'Date'[Date])))
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
@Anonymous ,
As a new column
New column =
var _max = maxx(filter(Table, [product] =earlier([product]) && [Sales date] < earlier([Sales date])),[Sales date])
return
maxx(filter(Table, [product] =earlier([product]) && [Sales date] =_max ),[Sales Amount])
As new measure with help from date table
Last Day Non Continuous = CALCULATE([sales],filter(ALLSELECTED('Date'),'Date'[Date] =MAXX(FILTER(ALLSELECTED('Date'),'Date'[Date]<max('Date'[Date])),'Date'[Date])))
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
11 | |
10 | |
10 | |
9 |
User | Count |
---|---|
18 | |
13 | |
12 | |
11 | |
8 |