Forum Discussion
How can I make sales Weekly Trend ?
Prepare your data model: Ensure that you have a date column in your dataset that represents the sales date.
Create a calendar table: If you haven't already, create a calendar table that includes a column for each day in your dataset. This table will allow you to group sales by week.
Create a measure for accumulative sales: You'll need to create a DAX measure that calculates the accumulative sales up to a certain week. Here's how you can do it:
Accumulative Sales =
VAR CurrentWeek = MAX('Calendar'[WeekNumber])
RETURN
CALCULATE(
SUM('Sales'[SalesAmount]),
'Calendar'[WeekNumber] <= CurrentWeek
)
In this measure, we use the MAX function to get the current week number from the calendar table. Then, we use the CALCULATE function to sum up the sales amount for all weeks less than or equal to the current week.
Create a line chart: Add a line chart to your Power BI report canvas.
Configure the line chart: Add the week number from your calendar table to the Axis field well of the line chart. Then, add the Accumulative Sales measure to the Values field well.
Format the chart: Customize the appearance of the chart as per your preferences, including titles, axis labels, and colors.
By following these steps, you should be able to create a weekly trend chart showing accumulative sales in Power BI using DAX.
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
In case there is still a problem, please feel free and explain your issue in detail, It will be my pleasure to assist you in any way I can.