Forum Discussion
Adding days since from a SQLdb Report
Good Morning PowerBI!
I have a report that queries a sql db directly and noticed if I added tables, it changes the type of report which will download all the tables which takes a while.
I was wondering if I can add a measure that wouldn't do this, or if changing the type of query was the only option.
I'm see there is a column for date opened and date closed, and the dates are like such below -
| 2/10/2015 12:56:02 AM |
I was hoping to calculate, days since opened, days to close, would any kind souls be able to answer the question about the direct query and maybe a sample calculation?
Thanks!
4 Replies
- parry2kSuper User
Anonymous not actually sure what you are looking for, Read this post to get your answer quickly.
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490 - v-lionel-msftCommunity Support
Hi Anonymous ,
If you don't want to load all the data every time you refresh, you can use incremental refresh.
Incremental refresh in Power BI
Or you can add sql statement.
We mainly use M language to deal with the problem of connecting data sources. DAX is generally used to model data.
Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- v-lionel-msftCommunity Support
Hi Anonymous ,
Has your problem been solved?
Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
v-lionel-msft Hi Lionel,
I actually figured it out. On a direct query database, if you use a measurement it will achieve what you need and in my case, it was days from a certain field.
Difference = DATEDIFF( *Table*[*Field*], TODAY(), DAY)adding this measurement allowed me to calculate the days passed from *field* (this was a date entered) without changing it from direct query.I added this for a group of folks who wanted to see immediate changes (refresh button mashers).Hopefully this may help other folks dealing with refresh mashers as well.