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
abc_777
Post Prodigy
Post Prodigy

how to find specific day sale in a week or month

hi, 

 

I want to find out sales for every week Wednesday, Thursday, and Friday

 

or

every 13th, 14th, and 15th day of each month

 

as I have promotion ongoing  

 

thanks

1 ACCEPTED SOLUTION

Hi,

Please find the below solution,

 

Aburar_123_0-1638092692887.png

 

Calculated columns in 'Date Dim',

   DateNo. = 'Date Dim'[Date].[Day]

   WeekDay = FORMAT('Date Dim'[Date],"ddd")

 

Measures,

 

Sales_on_13,14,15 = if(max('Date Dim'[DateNo.]) in {13,14,15},SUM(Orders[Sales]))
Sales_on_Weekdays = if(max('Date Dim'[WeekDay]) in {"Wed","Thu","Fri"},SUM(Orders[Sales]))

 

View solution in original post

7 REPLIES 7
amitchandak
Super User
Super User

@abc_777 , Create a column like day of month and week day in your table

 

day = day([Date])

Weekday = weekday([Date]) //Sunday =1

 

Then you can have filter

calculate(sum(Table[Value]), filter('Date', 'Date'[Day] =15))

 

calculate(sum(Table[Value]), filter('Date', 'Date'[WeekDay] =15))

 

Use with time intelligence

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]), 'Date'[Day] =15 )

 

for week refer

Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...
https://www.youtube.com/watch?v=pnAesWxYgJ8

 

Power BI — Month on Month with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
https://www.youtube.com/watch?v=6LUBbvcxtKA

hi, thanks for your reply

 

is it possible to make it more clear by sharing a pbi file

 

hi, 

 

to find out sales for every week Wednesday, Thursday, and Friday

 

thanka

@Amit 

 

I have done the following measure

 

day = day([Date]) ----------------- [Date] is from my global date table bmcalendar
Weekday = weekday([Date]) -----------------  [Date] is from my global date table bmcalendar

 

15th day = Calculate('Measure Table'[Actual Quantity (Measure) (KG)], filter(BMCalendar, BMCalendar[Date] = 15))   ------------------ actual quantity is my quantity measure and BMCalendar is my global calender
 
15th Weekday = Calculate('Measure Table'[Actual Quantity (Measure) (KG)], filter(BMCalendar, BMCalendar[Weekday] =15))

 

15th MTD = CALCULATE('Measure Table'[Actual Quantity (Measure) (KG)],DATESMTD('BMCalendar'[Date]), BMCalendar[day] =15 )

 

I got following,

 

where I mistake. please suggest

abc_777_0-1638077742551.png

 

 

 

HI, Can you please share an excel screenshot of you expected result.

@Aburar_123 ,

 

I don't have an excel file for expectations. But what we have every Wednesday, Thursday, and Friday we have promotion ongoing. and for this purpose, we need this calculation

Hi,

Please find the below solution,

 

Aburar_123_0-1638092692887.png

 

Calculated columns in 'Date Dim',

   DateNo. = 'Date Dim'[Date].[Day]

   WeekDay = FORMAT('Date Dim'[Date],"ddd")

 

Measures,

 

Sales_on_13,14,15 = if(max('Date Dim'[DateNo.]) in {13,14,15},SUM(Orders[Sales]))
Sales_on_Weekdays = if(max('Date Dim'[WeekDay]) in {"Wed","Thu","Fri"},SUM(Orders[Sales]))

 

Hi @Aburar_123 ,

 

Thanks, it's perfect. great

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

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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