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

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 4
v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

 

Has your problem been solved?

 

Best regards,
Lionel Chen

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

Anonymous
Not 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.
 
 
v-lionel-msft
Community Support
Community 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.

c8.PNG

We mainly use M language to deal with the problem of connecting data sources. DAX is generally used to model data.

 

Best regards,
Lionel Chen

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

 

 

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



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

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.

Top Solution Authors