Thanks for the using Microsoft Q&A . I think if you could have shared the folder structure that could have helped . Since you are using datetime and then deriving the year , month , etc , you need to make sure that the folder exists there .
eg On my side of the world right now its 2023/11/14 11:31 AM, so if I run the query now, I need to have the below structure so we that we can pull the data.
WorkspaceResourceId=/subscriptions/xxxxxxxxxxxxxxx/resourcegroups/appinsights/providers/microsoft.operationalinsights/workspaces/metrics/y=2023/m=11/d=14/h=11/m=28
HTH .
Thanks
Himanshu