One problem which forced me to pause for thought recently was how to dynamically filter data in Power BI. Eg: Filtering data by a date range to only show sales for the last 7 days.
I believe the two simplest options are using either the Q&A natural query language or using Power BI Desktop’s built in Date/Time filter options found in the query editor, both of which have been documented below.
Option 1 – Using the Power BI web app
Using the Q&A text box of your dashboard you can simply ask in “natural language” to see your data from the last 7 days, as shown in the screenshot below. This can then be pinned to the dashboard if it is a question you are going to ask on regular basis.
This does take a little bit of tweaking to get the desired results as you are relying on the Power BI engine to understand your query.
Fortunately if no results are found Power BI does give you some suggestions should it not be able to find useful answers to your question, as shown in the screenshot below.
Option 2 – Using the Power BI Desktop app
When you import data using Power BI Desktop you are greeted with the Query Editor, from here you can click the drop down arrow for the date column in question. Next select Date/Time Filters and you will be exposed to a number of filtering options unavailable in the reports or dashboard tabs, From here I have selected “In the Previous”.
Once you have selected your filter (eg: In the Previous) all you need to do is set how many days you want to count back. In this instance the result of this filter means that I am only going to see data in my reports where the Created Date is in the previous 7 days.
The Microsoft Power BI team have already included a few useful built in filters, such as the Year To Date filter shown in the screenshot below.
Pareto Charts in Power BI and the DAX behind them
The Pareto principle, commonly referred to as the 80/20 rule, is a concept of prioritisation.
Apr
AI Assistance in Microsoft Fabric
The exponential growth of Large Language Models (LLMs) couples with Microsoft’s close partnership with OpenAI
Apr
10 reasons why it’s worth the effort to understand the value of your data
“If leaders really want to create a data driven culture, the journey starts with them!
Apr
Content Safety in Azure AI Studio
Azure AI Content Safety is a solution designed to identify harmful content, whether generated by
Apr
Model Benchmarks in Azure AI Studio
In the constantly changing field of artificial intelligence (AI) and machine learning (ML), choosing the
Apr
Celebrating International Women’s Day: from Classroom to Code
As we celebrate International Women’s Day, I want to share my journey of breaking stereotypes
Mar
Pretty Power BI – Adding Pagination to Bar Charts
Good User Experience (UX) design is crucial in enabling stakeholders to maximise the insights that
Feb
Pretty Power BI – Creating Dynamic Histograms
Good User Experience (UX) design is crucial in enabling stakeholders to maximise the insights that
Feb