Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I am exporting all data from a log table in App Insights to Power BI as an M query. I want to create a semantic model or dataflow in Power BI that allows me to refresh the data to retrieve the latest values from all columns in the table. I have been able to export the data and add it as a blank query in the advanced editor, but I am struggling with the correct way to use the timestamp field in the table to write in the date range in the M query.
Essentially, I'm hoping to (upon retrieval of new data) to have the query pull data from the last 90 days of data up to the current date/time. I am currently just getting the date range I set when querying the log data in App Insights before exporting the query. I only need the events and timestamps in the table to create some basic funnels, so I think defining the date correctly to get new data is the only hurdle.
For example, in SQL I would write it as:
timestamp>=DATEADD(DAY,-90,CONVERT(date,GETDATE()))
Solved! Go to Solution.
Hi @Eleanor24 ,
Please try this:
let
Source = YourTableName, // Replace with your actual data source
CurrentDate = DateTime.From(DateTime.Date((DateTime.LocalNow()))),
StartDate = DateTime.From((Date.AddDays(CurrentDate, -90))),
FilteredRows = Table.SelectRows(Source, each [datetime] >= StartDate and [datetime] < Date.AddDays(CurrentDate,1))
in
FilteredRows
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group
Hi @Eleanor24 ,
Please try this:
let
Source = YourTableName, // Replace with your actual data source
CurrentDate = DateTime.From(DateTime.Date((DateTime.LocalNow()))),
StartDate = DateTime.From((Date.AddDays(CurrentDate, -90))),
FilteredRows = Table.SelectRows(Source, each [datetime] >= StartDate and [datetime] < Date.AddDays(CurrentDate,1))
in
FilteredRows
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
8 | |
6 | |
6 | |
5 | |
5 |
User | Count |
---|---|
9 | |
9 | |
8 | |
6 | |
6 |