cancel
Showing results for
Did you mean:

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a \$100 discount. Register Now

Frequent Visitor

## Calculate Count of Customers when TopN Filter Changes

Hello,

I'm hoping someone can help with this.

I have a report that lists Client, Revenue and Rank.

I also have several filters in the filter pane along with a filter to show TopN that may change from 10 to 100 in increments of 5.

Next to the list of client information, I have a summary that shows total revenue and client count.

Everything filters fine when I use the filters on the filters pane, however, when I choose a different "TopN" number, the Client Count and the Total Rev amount to not update to show the numbers, they stay the same.  I'd like to see that where the TopN Filter Selection changes as shown below, the count and revenue numbers update as well.

I have done many searches, and perhaps I am not wording my questions correctly, but I have been unable to find anything helpful.

Is what I am looking to do possible?

1 ACCEPTED SOLUTION
Super User

Hi,

You will have to create a disconnected table (named TopN with a single column called number) with numbers ranging from 1-5.  Create a slicer and select 3 there.  Write these measures

Selected Top n value = selectedvalue(Topn[Number])

Revenue from Top n customers = sumx(topn([Selected Top n value],values(Data[Customer]),[Revenue]),[Revenue])

Hope this helps.

Regards,
Ashish Mathur
http://www.ashishmathur.com
4 REPLIES 4
Super User

Hi,

You will have to create a disconnected table (named TopN with a single column called number) with numbers ranging from 1-5.  Create a slicer and select 3 there.  Write these measures

Selected Top n value = selectedvalue(Topn[Number])

Revenue from Top n customers = sumx(topn([Selected Top n value],values(Data[Customer]),[Revenue]),[Revenue])

Hope this helps.

Regards,
Ashish Mathur
http://www.ashishmathur.com
Frequent Visitor

This worked great, thank you so much!

Super User

You are welcome.

Regards,
Ashish Mathur
http://www.ashishmathur.com
Super User

are you able to share your data?  and can you give an example of what you expect the output to be.

If you cannot share your data please provide some sample data in text format.

If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!

Announcements

#### Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

#### Power BI Monthly Update - February 2024

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

#### Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

#### Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors