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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.