Forum Discussion
Difference between dates - power query
Hi camargos88 ,
At the moment I have a direct query to a table in SQL Server. I would like to make this change in Power query without any change to the table in the db.
I have recreated this in the Adventure works and this is the query generated. WHere do you reckon I need to change?
let
Source = Sql.Database("******", "AdventureWorks2012"),
HumanResources_Employee = Source{[Schema="HumanResources",Item="Employee"]}[Data],
#"Removed Columns" = Table.RemoveColumns(HumanResources_Employee,{"Person.Person", "Production.Document", "Purchasing.PurchaseOrderHeader", "Sales.SalesPerson"}),
#"Sorted Rows" = Table.Sort(#"Removed Columns",{{"BirthDate", Order.Ascending}})
in
#"Sorted Rows"
Hi Anonymous ,
After select Direct Query, you click on Advanced options and write your custom SQL.
- Anonymous6 years agoNot applicable
Thanks camargos88 .
I was thinking if there are other ways of using Power BI functionalities to calculate this.
- Anonymous6 years agoNot applicable
Hi Anonymous ,
Whether the problem has been resolved? If yes, could you please mark the helpful post as Answered? It will help other members in the community find the solution easily if they face the similar problem with you. Thank you.
Best Regards
Rena
- PBIfanatic6 years agoHelper V
Hi Anonymous ,
No, it isnt unfortunately.
- Anonymous6 years agoNot applicable
Hi PBIfanatic ,
You can use the function DATEDIFF in DAX to create one calculated column instead of calculating the difference between dates in Power Query:
Best Regards
Rena