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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
loginarun
Frequent Visitor

undefined

The file “exercise_data.xlsx” contains two sheets of data:
 “sales” which contains the sales for a single product sold by an e-shop:
 payment_type = the payment type of the order
 order_datetime = the date and time the order was placed
 sold_quantity = the number of units sold in that order
 total_amount = the total amount paid for those units
 “returns” which contains the number of items that have been returned from a specific order:
 return_datetime = the date and time the order was placed
 returned_quantity = the number of units which have been returned.

To complete the 3 exercises, please recreate the attached graphs in POWER BI desktop and apply your best approach in DATABASE STRUCTURE, CODE STRUCTURE and BASIC PAGES GRAPHIC DESIGN. Please don’t apply changes to the file used as input.

Exercise 1:
The owner of the shop wants to visualize a month to month comparison of the latest and last month, meaning June and July 2022, total amount from the sales sheet. However, given the very strong weekly seasonality of the business, syncing the 1st day of both months, 2nd day of both months, etc. would not give a true sense of the variation so instead, the owner would like to overlap the first Monday of the current month to the first Monday of the last month, etc…

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @loginarun ,

Below is my test data.

vdengllimsft_0-1732597893124.png


Create a measure showing sales on the same day of the previous week.

Sales previous week = 
CALCULATE(
SUM(sales[total_amount]),
'sales'[order_datetime]=MAX('sales'[order_datetime])-7,
ALLEXCEPT('sales',sales[order_datetime])
)


Then create a measure showing the percentage change in sales.

Percentage change per week = 
DIVIDE(SUM(sales[total_amount])-[Sales previous week],[Sales previous week])


Place the measures and table fields into the table visual as shown below.

vdengllimsft_1-1732598119640.png


Please see the pbix for reference.

Best Regards,
Dengliang Li

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

View solution in original post

4 REPLIES 4
loginarun
Frequent Visitor

Thanks for the Support

loginarun
Frequent Visitor

Thanks

 

Anonymous
Not applicable

Hi @loginarun ,

Below is my test data.

vdengllimsft_0-1732597893124.png


Create a measure showing sales on the same day of the previous week.

Sales previous week = 
CALCULATE(
SUM(sales[total_amount]),
'sales'[order_datetime]=MAX('sales'[order_datetime])-7,
ALLEXCEPT('sales',sales[order_datetime])
)


Then create a measure showing the percentage change in sales.

Percentage change per week = 
DIVIDE(SUM(sales[total_amount])-[Sales previous week],[Sales previous week])


Place the measures and table fields into the table visual as shown below.

vdengllimsft_1-1732598119640.png


Please see the pbix for reference.

Best Regards,
Dengliang Li

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

Need same day of previous Month Example  if 4-Apr-2022 is monday the previous month of first monday like 3-Mar-2022 it will show
below the line chart Test.jpgTest1.jpg

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors