Skip to main content
cancel
Showing results for 
Search instead 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

Reply
michellem0771
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.

michellem0771_0-1701898477511.png

 

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.

michellem0771_1-1701898505233.png

 

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

michellem0771_2-1701898569984.png

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.

michellem0771_3-1701898695971.png

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?

 

Thanks for any help you can provide!

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
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
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
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
https://www.linkedin.com/in/excelenthusiasts/

This worked great, thank you so much!

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
vanessafvg
Super User
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!




Helpful resources

Announcements
Fabric Community Conference

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.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

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