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
Anonymous
Not applicable

Same reports on different period of times

Hello world~

 

I have a report that shows data from the last hour (monitoring screen). But my client now want to have "Last Hour", "Last Day", "Last Week" and "Last Month" on the same report.

 

How would you guys do it without any filters?

 

PS: I get my data from SQL Queries.

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi, @Anonymous

When you get data from SQL Queries, you need to get data at least since last month (the data you need),

then use DAX Function to create multiple calculate measures separately. for "Last Hour", "Last Day", "Last Week" and "Last Month"

drag these measures into visual. they show together.

 

Also, you could share some sample data and expected output. we can help you to create these measure. Do mask sensitive data before uploading.

 

 

 

Best Regards,

Lin

Community Support Team _ Lin
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

7 REPLIES 7
themistoklis
Community Champion
Community Champion

@Anonymous

 

If there is no restriction of showing the data from each one of the time periods on the same object (e.g. table or chart) then there mltiple ways for displaying the require info.

 

1. Create a separate field for each one of the time periods on the SQL query and then load the data on the report. Then make copies of the same object 4 times (for each one of the time periods) and add the relevant field (created on the sql query) in te filter panel

 

2. Create the time periods using DAX formulas in PowerBi and repeat the same process afterwards with copying the objects and adding the filtering.

 

3. Create 4 slicers (one for each time period) and link every slicer to the relevant object without affecting the other objects

v-lili6-msft
Community Support
Community Support

hi, @Anonymous

When you get data from SQL Queries, you need to get data at least since last month (the data you need),

then use DAX Function to create multiple calculate measures separately. for "Last Hour", "Last Day", "Last Week" and "Last Month"

drag these measures into visual. they show together.

 

Also, you could share some sample data and expected output. we can help you to create these measure. Do mask sensitive data before uploading.

 

 

 

Best Regards,

Lin

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

Hey @v-lili6-msft

 

For example here, we got :

Login.PNG

 

 

The script "login" was executed 4 times in the last hour with an 100% success rate. I need to do the same for last day.

Here I get my "Agent | Script" from the last month and the number of  loops and success rate for the hour ; therefore, if my script isn't executed in the last hour, it will show 0 loops.

 

I know I can make another query to get my data for "Last day", but is there another way?

 

PS: 

- My english might be bad (I'm not english ) Smiley Wink

- The project had to be done for today 4PM so don't take it too seriously, I won't make it on time (just want to know for further projects). Smiley Frustrated

- I didn't click on "Accept as Solution" on purpose... Smiley Indifferent

hi, @Anonymous

Does "Last Hour" is a script not a dax formula?

If it is a script, sorry I'm not familiar with scripts, you may post a new thread in Power bi Developer.

 

I know I can make another query to get my data for "Last day"

I think making another query is a good way for it.

 

you may try to continue to create  "Last Day", "Last Week" and "Last Month"  then

drag them into visual together.

 

Sorry for not being familiar with script development again.

 

Best Regards,

Lin

 

 

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

Hi,
copy the visual and filter it on visual level.
Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


Anonymous
Not applicable

@mwegener

 

There is no "Last Hour filter"... It's what I wanted to do...

... or create a query for each visual
Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


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.