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
joannerw
Helper I
Helper I

Find the days per month from Create Date to Finish Date - using Direct Query

I'm trying to create a table of days per month between the create date and finish date, which could span years. I have found a solution but it doesn't work for direct queries. Can anyone help? And I'm new to Power BI so may need a little extra help...

 

2019-12-16 11_53_10.png

6 REPLIES 6
v-lili6-msft
Community Support
Community Support

hi @joannerw 

Just use this formula to create a new table

Table = FILTER(CROSSJOIN('Defect',CALENDARAUTO()),[Date]>=[Defect Create Date]&&[Date]<=[Completion Date])

 

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.

Thank you for your reply. I'm unable to create a new table as the icon is greyed out. Is this because my data source is a direct query to an SQL database?

hi @joannerw 

Do you mean that only "New measure" is available in the power bi desktop?

 

 

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.

Only new measure and new column are available as shown.  

2019-12-18 09_32_46-.png

hi @joannerw 

You need to update power bi desktop to the latest version, and now It supports mixed mode that you could use New table in direct query.

https://www.microsoft.com/en-us/download/details.aspx?id=58494

 

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.

@v-lili6-msftI am currently running the version 2.73.5586.1501 64-bit (September 2019) and using Power BI Desktop RS which is hosted locally, and not on the cloud due to security issues. 

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.