Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
naanisim
Employee
Employee

X axis is not updating to last 7 days

I have a kusto query inside powerbi that is getting the correct data and shows the last seven days but when I go to look at the graph that was built in powerbi, it is not updating the x-axis and it is stuck in Setpember. I'm not sure what to do in order to fix it.

x axis: 

naanisim_0-1645226788677.png

The data the kusto query is showing in PowerBi:

naanisim_1-1645226837824.png

 

Inside the Fields section of PowerBi when looking at the graph where the x-axis is, there doesn't seem to be any errors coming up either:

naanisim_0-1645227267833.png

 

1 ACCEPTED SOLUTION

I figured out what the problem was. The data was refreshed to show the current dates but the graph itself also needed to be refreshed separately. Is there a button that does this all at once? Why would only the data refresh and not the graph that was using the data?

View solution in original post

5 REPLIES 5
v-stephen-msft
Community Support
Community Support

Hi @naanisim ,

 

What action did you use to make the visual show the last 7 days?

Is it possibile to provide some dummy data and expceted results?

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I am getting the last 7 days by using the following in a kusto query under Power Query Editor: 
[Query=[#"csl"="let lookback=7d; ... /*goes on to the rest of the query*/ ]
And the way I get the day in the Kusto query is:

naanisim_0-1645563806188.png

 

I figured out what the problem was. The data was refreshed to show the current dates but the graph itself also needed to be refreshed separately. Is there a button that does this all at once? Why would only the data refresh and not the graph that was using the data?

Hi @naanisim ,

 

Glad your issue was resolved.

And there's a button for refreshing data and visuals.

vstephenmsft_0-1645775698328.png

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@naanisim , You can get last 7 days using a measure like

 

//Last 12 based on today
new measure =
var _max = eomonth(today(),0)
var _min = _max -7
return
calculate( sum(Table[Value]), filter('Date', 'Date'[Date] >=_min && 'Date'[Date] <=_max))

 

 

But if you want select a value and then want 7 days, you need an independent date Table

 

//Date1 is independent Date table, Date is joined with Table
new measure =
var _max = maxx(allselected(Date1),Date1[Date])
var _min = _max -7
return
calculate( sum(Table[Value]), filter('Date', 'Date'[Date] >=_min && 'Date'[Date] <=_max))

 

Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI

 

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.