cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Elliott
Advocate II
Advocate II

How to specify different time periods from the same source data

Hello,

 

I am having difficulty attempting to figure out an issue I am currently facing.

 

I shall keep it in simple terms as my issue can apply to several different scenarios. 

 

Issue:

I have a single source of data compromising of several different columns.

One of the columns I have created is Date which simply holds the date of each entry in the database.

 

I would like to create 2 graphs. For instance, the first graph I would like to display the last 7 days worth of my live data. The second graph I would like to show the last 30 days worth of data. 

How can I set these time parameters to allow to me make 2 graphs, using the same data source, but to display 2 different periods of time?

 

I understand that I can manually select the Date column in the level filters, but this will only allow me to manually select which days I would like to display. Whereas, what I am trying to achieve is a graph in which I will not have to manually change the selection every week and would like it to display the latest 7/30 days worth of data at that current time.

 

Is this possible to apply this at the presentation stage of creating the report, or is this something I will have to amend during the data manipulation, either on desktop or SQL (as this is where my data resides)?

 

Thanks alot,

Elliott

 

 

 

 

Edit:

 

Through some more research.. It's looks like I am going to have to introduce a mesure('s), if someone could point me in the right direction regarding this, that would be great Smiley Happy

1 ACCEPTED SOLUTION
Greg_Deckler
Super User IV
Super User IV

Create a new column with the formula:

 

Days Aging = DATEDIFF([Date],TODAY(),DAY)

 

This will give you number of days in the past and allow you to use it as a filter in your visualizations for last 7 days and last 30 days.


---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




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

Proud to be a Super User!




View solution in original post

1 REPLY 1
Greg_Deckler
Super User IV
Super User IV

Create a new column with the formula:

 

Days Aging = DATEDIFF([Date],TODAY(),DAY)

 

This will give you number of days in the past and allow you to use it as a filter in your visualizations for last 7 days and last 30 days.


---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




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

Proud to be a Super User!




View solution in original post

Helpful resources

Announcements
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
Top Kudoed Authors