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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Nathaniel1307
New Member

Day and Time Relative to the Start of the Week

I work in the events industry and want to analyse ticket sales over time but then compare these to the previous week.

We release our tickets for that weeks events on Monday Afternoon. The dataset coming into power bi is a transaction report for each ticket sale and gives a date and time for the sale.

I currently have a line chart showing ticket sales over time split by event but when I want to compare this weeks sales to last weeks theyre not overlaid on a line chart as the sales are a week later which leads to a chart like the below:

Nathaniel1307_0-1701217457274.png

I want a way to see each weeks sales over time overlaid on top of each other.

Any assistance would be greatly appreciated!

2 REPLIES 2
Villezekeviking
Most Valuable Professional
Most Valuable Professional

You can also use a combination of a calendar table in DAX I've made with Selectedvalue.

Both are described in these 2 posts.

 

https://www.villezekeviking.com/dax-magic-with-selectedvalue/
https://www.villezekeviking.com/dax-tables-calendar-and-time/

jdbuchanan71
Super User
Super User

What about adding a Sales Day column to your data that calculates the number of days since the first sale for that event.  Then you can make the Sales Day the X axis on your chart and that would align events from different weeks together.

 

Sales Day = 
VAR _SalesStart =
    CALCULATE ( MIN ( 'YourTable'[Date] ), ALLEXCEPT ( 'YourTable', 'YourTable'[Event] ) )
RETURN
    'YourTable'[Date] - _SalesStart + 1

 

jdbuchanan71_0-1701223728726.png

You can see that the Sales Day goes from 1 - 5 for both events even though the first sales for that event was on differnet days.

You can see how they stack together with the Sales Day as the x axis.  You could also have a date filter on the page to only look at events in a certain date range to filter it down.

jdbuchanan71_0-1701225375913.png

 

 

 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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