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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
naanisim
Microsoft Employee
Microsoft 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

 

 

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.