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
ahmoh43
New Member

How can I make sales Weekly Trend ?

I want to make a weekly trend chart , 

i want to show sales by week as accumlative trend

3 REPLIES 3
v-zhengdxu-msft
Community Support
Community Support

Hi @ahmoh43 

 

Could you please provide more raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

 

Best Regards

Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

danextian
Super User
Super User

Hi @ahmoh43 ,

We can only give you a general advise without enough information. @123abc has already given you one and pretty detailed at that given the data provided. If you want a better answer, please provide a workable sample data (not an image).










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
123abc
Community Champion
Community Champion

  1. Prepare your data model: Ensure that you have a date column in your dataset that represents the sales date.

  2. 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.

  3. 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.

  1. Create a line chart: Add a line chart to your Power BI report canvas.

  2. 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.

  3. 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.

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

March 2024 PBI Gallery Image

Power BI Monthly Update - March 2024

Check out the March 2024 Power BI update to learn about new features.