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
sunnight
Regular Visitor

Adding date to a table in order to make time based comparisons

Hi,

 

I have a table where I have a column called Order_Creation_Date. What I do not have is a standard Date column.

 

What I want to achieve is create a line chart where I can compare the current day with yesterday, current week with the past week or the current month with the past month with the use of  Order_Creation_Date (of course I will connect it with product_id in order to have a count of products that were created on the same day).

 

What would be the best way to achieve that? 

 

PS. There could be days where there was no orders, so there was no Order Creation Date as well, but still then I want to summarize the orders from the whole day/week/month and be able to compare them in time on a line chart

1 REPLY 1
PaulDBrown
Community Champion
Community Champion

@sunnight 

It is always recommended to create a calendar table to use in slicers, filters and measures. You can create a new table (option in the ribbon) and use the CALENDARAUTO or CALENDAR functions. Either will generate a new table with consecutive dates. You can then add MONTH, YEAR etc columns to this table. Link the new Calendar table to the data table using the date in the Calendar table and your Order_Creation_Date as a single-to-many relatiosnhip.

you can then use this Calendar table to filter in measures, time-intelligence, slicer etc...





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






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.