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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Syndicate_Admin
Administrator
Administrator

Sales calculation for campaigns with different dates each year

Hello! I need help with the following decisions
I have a Sales table, with a sale date, and a related Calendar table.
Now I must calculate sales for different special dates. These dates vary from year to year, and a particular date can fall into more than one type of event. For example:

NAMEINITIAL DATEEND DATEYEAR
BLACK FRIDAY CAMPAIGN 19/11/202423/11/20242024
BLACK FRIDAY CAMPAIGN 18/11/202521/11/20252025
CHRISTMAS15/11/202425/12/20242024
CHRISTMAS18/11/202530/12/20252025


I have to create measures like sales amount, PY sales amount, and PY ALL sales amount for each of these events.
Should I relate this table to calendar by year? Or make another table that is [NAME, DATE]
If you kept only this table, how could you calculate sales for example Christmas?
If I wanted to use DATESBETWEEN I wouldn't have a unique value for INITIAL DATE and END DATE.
I welcome feedback on how best to model it!

Thank you!

Edit: Expected Result

PRODUCT IDSALESCHRISTMAS SALES
324451345102
536253452500
7183220
YEARSALESCHRISTMAS SALES
20231789165
20242710437
20253000
3 REPLIES 3
v-mengmli-msft
Community Support
Community Support

Hi @Lullabit13 ,

 

Which table is this?

NAME INITIAL DATE END DATE YEAR
BLACK FRIDAY CAMPAIGN 19/11/2024 23/11/2024 2024
BLACK FRIDAY CAMPAIGN 18/11/2025 21/11/2025 2025
CHRISTMAS 15/11/2024 25/12/2024 2024
CHRISTMAS 18/11/2025 30/12/2025 2025

 

What does your Sales table look like? The expected output for Christmas sales is this, but what about Black Friday?

PRODUCT ID SALES CHRISTMAS SALES
32445 1345 102
53625 3452 500
71832 2 0
     
YEAR SALES CHRISTMAS SALES
2023 1789 165
2024 2710 437
2025 300 0

 

Could you please provide sample data or a pbix file(does not include private data)? That will help us provide solutions.

 

 

Best regards,

Mengmeng Li

danextian
Super User
Super User

Hi @Syndicate_Admin 

 

What do you want to achieve? What is your expected result? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447... 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


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

I need to do this kind of array, plus the event type should be a slicer within the report.

PRODUCT IDSALESCHRISTMAS SALES
324451345102
536253452500
7183220
YEARSALESCHRISTMAS SALES
20231789165
20242710437
20253000

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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