Forum Discussion
Import Max Value Records from Source data
- 5 years ago
here a example of the needed statement:
hey,
for this you would need to send a sql statement directly to the source to do the handling and get you the filtered data would be the best option here (that option its on the source conection under advanced options sql statement):
using select sql max value by ID statement you would get that result.
if this helped give some kudos and mark as solution for others to find.
- StefanoGrimaldi5 years agoResident Rockstar
here a example of the needed statement:
- negi0075 years agoCommunity Champion
StefanoGrimaldi Thank you for guiding me in the right direction. I was able to do what I wanted to achieve. Also got to know how we can use native SQL command in powerquery instead of usual m-query language.
Below is the linkon writing SQL queries in powerquery
my final query was similar to below code
select * from ProdctMaster
where ProductMasterID in (SELECT max(ProductMasterID) FROM
ProductMaster GROUP BY ProductName )- StefanoGrimaldi5 years agoResident Rockstar
grad could help, just keep in mind the more you send over SQL statement the load of that its worked by the datasource not Power BI, so thats a factor to keep in mind when deciding M vs sending query to the source to get the result via SQL.