Does range vector accepts variables?

I am using Grafana version - 9.4.3. I am trying to create a monthly bar chart of all nodes’ costs for the past 3 months. Right now, I am using the below queries, but there will be an overlap in the midweeks if we go with a 4 or 8-week offset. There is no month option in the range vector. If I try to give custom variable, the range vector throws the error - bad_data: invalid parameter “query”: 1:43: parse error: bad duration syntax: “da”

Queries I am using:

Q1: sum(sum_over_time(node_total_hourly_cost offset 8w [8w:1h]))
Q2: sum(sum_over_time(node_total_hourly_cost offset 4w [4w:1h]))
Q3: sum(node_total_hourly_cost)* 24 * day_of_month()

Using variable
sum(sum_over_time(node_total_hourly_cost [$timeRangeDay:1h]))

I have stored day_in_month() value in timeRangeDay and it is completely working fine for Q3. But I am getting the below error when I use it in range.

Could someone please help me with the queries to get the right bar chart for monthly costs?
Also, how to display the x-axis with month?