How can I dynamically filter Top N customers based on sales in the most recent fiscal quarter using a time slicer

0 votes

How can I dynamically filter Top N customers based on sales in the most recent fiscal quarter using a time slicer?
I want to filter the Top N customers based on sales in the most recent fiscal quarter using a time slicer in Power BI. I need to understand how to create a dynamic filter that updates automatically as the time slicer changes, showing only the top-performing customers for the selected quarter.

10 hours ago in Power BI by Evanjalin
• 33,850 points
10 views

1 answer to this question.

0 votes

To dynamically filter Top N customers based on sales in the most recent fiscal quarter using a time slicer:

  1. Create a Date Table with Fiscal Year and Fiscal Quarter columns.

  2. Create a Total Sales measure:

TotalSales = SUM('Sales'[Amount])

Create a measure for sales in the most recent fiscal quarter:

SalesInMostRecentQuarter = 
VAR MaxFiscalQuarter = CALCULATE(MAX('DateTable'[FiscalQuarter]), ALL('DateTable'))
VAR MaxFiscalYear = CALCULATE(MAX('DateTable'[FiscalYear]), ALL('DateTable'))
RETURN CALCULATE([TotalSales], 'DateTable'[FiscalYear] = MaxFiscalYear, 'DateTable'[FiscalQuarter] = MaxFiscalQuarter)

Create a rank measure for customers:

CustomerRank = 
RANKX(
    FILTER(ALL('Sales'[CustomerID]), NOT ISBLANK([SalesInMostRecentQuarter])),
    [SalesInMostRecentQuarter],
    , DESC, Dense
)

Add the Rank measure to a visual's filter and set it to Top N based on SalesInMostRecentQuarter.

Now, when using the time slicer, the Top N customers will update automatically based on sales in the most recent fiscal quarter.

answered 10 hours ago by anonymous
• 33,850 points

Related Questions In Power BI

+1 vote
2 answers
0 votes
1 answer
0 votes
1 answer

How do I dynamically switch measures in Power BI based on a slicer selection while maintaining performance?

To dynamically switch between different measures in ...READ MORE

answered Mar 10 in Power BI by anonymous
• 33,850 points
240 views
0 votes
1 answer

How can I create a rolling calendar table that updates automatically based on the latest data in my fact table?

You can use either Power Query or ...READ MORE

answered Mar 13 in Power BI by anonymous
• 33,850 points
231 views
0 votes
1 answer

Displaying Table Schema using Power BI with Azure IoT Hub

Answering your first question, Event Hubs are ...READ MORE

answered Aug 1, 2018 in IoT (Internet of Things) by nirvana
• 3,090 points
1,782 views
+1 vote
1 answer

Unable to install connector for Power Bi and PostgreSQL

I think the problem is not at ...READ MORE

answered Aug 22, 2018 in Power BI by nirvana
• 3,090 points
3,149 views
+2 votes
2 answers

Migrate power bi collection to power bi embedded

I agree with Kalgi, this method is ...READ MORE

answered Oct 11, 2018 in Power BI by Hannah
• 18,520 points
1,944 views
+1 vote
1 answer

Connect power bi desktop to dataset and create custom reports

Open power bi report nd sign in ...READ MORE

answered Oct 10, 2023 in Power BI by Monika kale

edited Mar 5 2,143 views
0 votes
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP