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
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
Super User

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!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

1 REPLY 1
Greg_Deckler
Super User
Super User

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!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.