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.
Hello, I have some data in power BI that is connected to a SQL database via a Direct Query connection. I am having issues trying to only show the last X amount of readings, or reading over the last X amount of days. I tried using the Age function built into Power BI, but it would not work with a Direct Query connection. The time data that I am receiving is in the following format.
6/17/2017 3:05:00 PM |
Any advice on how to limit the readings shown on my graphs would be greatly appreciated.
Solved! Go to Solution.
Thanks for the help @MFelix.
I was able to figure out a solution to my problem. I was able to use a SQL statement to only bring in the last 24 hours of data into Power BI.
The SQL statement that I used was
select Name, location, myDate from myTable where myDate between DATEADD(hh, -24, GETDATE()) and GETDATE()
Hi @ejwwelshboy,
If you want to limit the amount of data you are receiving from SQL try to use a parameter to pass along the number of dsays you want to deduct from your query, check this page on parameters for power bi and you can take some ideas.
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @MFelix,
I don't think ising the parameters function would work in my case becase while I can use it to only show certain days I have no way to only show the last 2 days of data that is constantly being refreshed using the direct query connection.
Thanks,
Ejwwelshboy
Hi @ejwwelshboy,,
Can you please explain and show some example of what you want.
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsThanks for the help @MFelix.
I was able to figure out a solution to my problem. I was able to use a SQL statement to only bring in the last 24 hours of data into Power BI.
The SQL statement that I used was
select Name, location, myDate from myTable where myDate between DATEADD(hh, -24, GETDATE()) and GETDATE()
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
97 | |
78 | |
63 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |