cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
c5966 Regular Visitor
Regular Visitor

timestamp - last 24 hours on x axis (for me its showing 12 AM today until now)

Hi Team,

 

I would like to display last 24 hours of data on my axis out of last 2 days of data which I have in my query. But I can see only 12 AM today until now data.

 

Please see attached data and output (screenshots).

Input query.pngInput dataOutput data.pngOutput data

 

 

 

 

 

 

 

 

 

 

 

Expected Output would be, if its 2 PM now (06/11 - 2 PM ) then it should display, data between (06/10 - 2 PM) and (06/11 - 2PM). 

 

I tried changing the Type from Continuous to Categorical. But my data has minute to minute data, so it shows every minute data. 

My requirement is to see overview data, like 12 PM, 6 PM, 12 AM, 6 AM, 12 PM on x-axis for last 24 hours data.

 

 

Filter Type.pngFiltersOutput categorical x axis.pngCategorical Type x axis

 

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft v-cherch-msft
Microsoft

Re: timestamp - last 24 hours on x axis (for me its showing 12 AM today until now)

Hi @c5966 

You may use Date column in the data as x-axis.Then use the below Date measure in visual level filter and set it is 1 or is not blank like this post.

Reference:https://www.sqlbi.com/articles/applying-a-measure-filter-in-power-bi/

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Microsoft v-cherch-msft
Microsoft

Re: timestamp - last 24 hours on x axis (for me its showing 12 AM today until now)

Hi @c5966 

You may try to create a measure to filter the visual.

Reference:https://community.powerbi.com/t5/Desktop/Showing-only-the-last-3-hours/td-p/210783

Measure =
VAR hourdiff =
    DATEDIFF ( MAX ( Table2[DateTime] ), NOW (), HOUR )
RETURN
    IF ( hourdiff >= 24, 1 )

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
c5966 Regular Visitor
Regular Visitor

Re: timestamp - last 24 hours on x axis (for me its showing 12 AM today until now)

Hi,

 

 

 

 

 

 

Microsoft v-cherch-msft
Microsoft

Re: timestamp - last 24 hours on x axis (for me its showing 12 AM today until now)

Hi @c5966 

You may use Date column in the data as x-axis.Then use the below Date measure in visual level filter and set it is 1 or is not blank like this post.

Reference:https://www.sqlbi.com/articles/applying-a-measure-filter-in-power-bi/

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

c5966 Regular Visitor
Regular Visitor

Re: timestamp - last 24 hours on x axis (for me its showing 12 AM today until now)

Thank you for your response.

 

I can still see 12 hours of data after adding the measure in the visual level filter.

 

still issue.png

 

 

I would like to see last 24 hours of data, instead of 12 hours or 18 hours.

 

 

Appreciate your help.

 

Thanks

Helpful resources

Announcements
New Kudos Given Badges Coming

New Kudos Given Badges Coming

We're rolling out new Kudos Given badges. Find out how many Kudos you've given.

Power Platform World Tour

Power Platform World Tour

Find out where you can attend!

Top Kudoed Authors (Last 30 Days)
Users online (2,733)