Forum Discussion
Latest Value based on date column in string format in DirectQuery
Hi,
I am using the DirectQuery connection to access a database that collects in real-time the battery level of a device.
I want to be able to show the latest battery value from the 'Battery' column in a card visual based on the latest registered date time from the 'Date' column. I tried to follow the advice(s) from this post: https://community.powerbi.com/t5/Desktop/Latest-Value-Direct-Query/td-p/471523
However, my Date column is written in the date/time/timezone format (ex: 2020-10-30 13:15:30Z) and stored as a String, so when I try to create the measure from the above link, it doesn't properly execute my request.
I can't change the format of the DateTime column in the database and PowerBI doesn't let me transform the format of the column, during the Direct Query Mode. I saw other posts suggesting to check the "Allow unrestricted measures in DirectQuery mode" in the Options menu but this option doesn't appear for me.
Can someone please help me or advise me on what I should do? Let me know if you need additional information.
Thanks,
Nermeen
1 Reply
- lbendlin
Super User
You may be interested in the brand new dynamic query parameters function in Power Query
Power BI October 2020 Feature Summary | Microsoft Power BI Blog | Microsoft Power BI