cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SanketBhagwat
Helper V
Helper V

Best Selling Day

I have a table which contains Product,Sales and Date column.

I want to create a measure which will give me the best selling day for the particular product.

My table has values like,

ProductSalesDate
Dell2000014-06-2021
HP4555520-01-2020
Toshiba6888812-08-2020

 

I first created a measure for Average Sales Per day using 

Average Sales Per Day =
AVERAGEX(VALUES(Sheet1[Date].[Date]),[Total Sales]).
 
I know that we have to make use TOP N DAX, but I am not able to figure out a formula for the same.
 
If someone can help, then do please let me know.
 
Regards,
Sanket Bhagwat
1 ACCEPTED SOLUTION
SanketBhagwat
Helper V
Helper V

Okay, I have solved this thing.

 

1)I first created a measure for 'Average Sales per Day" as

        Average Sales Per Day =

AVERAGEX(VALUES(Sheet1[Date].[Date]),[Total Sales]).
 
2)Then I calculated 'Best Selling Date' as,
  
Best Selling Date =
MAXX(
TOPN(1,
SUMMARIZE(Sheet1,Sheet1[Date].[Date],
"Selling Days",[Average Sales Per Day]),
[Selling Days]),
Sheet1[Date].[Date]
)
Here I got the best selling date and not the actual Date.
 
3)So I converted it into dddd format as
  
Best Selling Day =
FORMAT([Best Selling Date],
"dddd")
This gives me the Best Selling Day.

Regards,
Sanket Bhagwat.

If this post helps, then please mark it as 'Accept as Solution".

View solution in original post

2 REPLIES 2
SanketBhagwat
Helper V
Helper V

Okay, I have solved this thing.

 

1)I first created a measure for 'Average Sales per Day" as

        Average Sales Per Day =

AVERAGEX(VALUES(Sheet1[Date].[Date]),[Total Sales]).
 
2)Then I calculated 'Best Selling Date' as,
  
Best Selling Date =
MAXX(
TOPN(1,
SUMMARIZE(Sheet1,Sheet1[Date].[Date],
"Selling Days",[Average Sales Per Day]),
[Selling Days]),
Sheet1[Date].[Date]
)
Here I got the best selling date and not the actual Date.
 
3)So I converted it into dddd format as
  
Best Selling Day =
FORMAT([Best Selling Date],
"dddd")
This gives me the Best Selling Day.

Regards,
Sanket Bhagwat.

If this post helps, then please mark it as 'Accept as Solution".

View solution in original post

TarunSharma
Responsive Resident
Responsive Resident

Hello @SanketBhagwat 
Please check this link .

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Top Solution Authors