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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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
v-denglli-msft
Community Support
Community Support

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

 

v-denglli-msft
Community Support
Community Support

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
ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.