Thank you for reaching out to Microsoft Q&A for this question.
I was not able to clearly understand the question here, but the following information should help you in this regards (tags in Cost/Usage Management).
In general, not all the resources support tag in Azure. Please refer to this link for details - Tag support for Azure resources
Also, please see the following link to understand more about tags in cost and usage data - How tags are used in cost and usage data
If the details above do not answer your question, can you please share more details about it? Refer to the following for some suggestions to include:
1. clarify "some of the tag values are coming as "null" or ''(blank).". Do you mean that some of the resources do not have tags in the response of API? An example scenario should help clarify it.
2. clarify "same filter when used in azure portal". How are you using the same filter in Azure Portal? A screenshot should help add more details to it.
Please let me know if you have any questions.
---
Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.