Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
TimB99
Regular Visitor

Dynamic summary table based on slicers

Hi, 

I'm currently working on a Power BI project and have encountered a challenge that I hope to get some guidance on. My dataset consists of project information, where each row represents a distinct project. The core of my issue revolves around creating a dynamic table visualization. Specifically, I aim to showcase the number of locations corresponding to various project counts. I've seen some other posts about dynamic summary tables, but I didn't find the solution to my problem yet.

 

To illustrate, I wish to summarize my data in a manner that displays the count of projects per location and then aggregate this information to show how many locations have each specific count of projects. This summary is straightforward to achieve through a calculated table, and I've successfully created one that meets my needs. However, the complication arises with my desire for this summary to dynamically adjust based on the selections made in slicers within my report. I understand that calculated tables do not update with slicer changes, but only upon data refresh, which does not suit my need for interactive adjustments.

 

The challenge I'm facing is converting this logic into measures that can be used in a table visualization, thereby ensuring the summary reacts dynamically to slicer selections. Despite my efforts, I have not been able to accomplish this using measures.

 

Could anyone provide insights or guidance on how I can achieve a dynamic summary table that updates based on slicer inputs using measures instead of a static calculated table? Below is a simplified version of my data structure to aid in understanding my situation.

TimB99_0-1708592906794.png 

TimB99_1-1708592952759.png 

I've uploaded the file here:

https://drive.google.com/file/d/1mDCmxySqSn6QGIONRWas18pTdbPZeDvC/view?usp=sharing 

1 ACCEPTED SOLUTION
v-cgao-msft
Community Support
Community Support

Hi @TimB99 ,

Please:
1. create a new measure:

 

Max count = 
VAR __max_count = MAXX(SUMMARIZE(ALL('Projects'),'Projects'[location],"@count",[project_count]),[@count])
RETURN __max_count

 

2. create a new table:

 

Table = GENERATESERIES(1,[Max count],1)

 

3. create a new measure:

 

Amount of locations = 
VAR __summary_table_1 = SUMMARIZE('Projects','Projects'[location],"@count",[project_count])
VAR __summary_table_2 =  SUMMARIZE(__summary_table_1,[@count],"@amount of locations",DISTINCTCOUNT(Projects[location]))
VAR __cur_count = SELECTEDVALUE('Table'[Value])
VAR _result = MAXX(FILTER(__summary_table_2,[@count]=__cur_count),[@amount of locations])
RETURN
_result

 

Output:

vcgaomsft_1-1708654865243.png

vcgaomsft_3-1708654915015.png

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

View solution in original post

2 REPLIES 2
v-cgao-msft
Community Support
Community Support

Hi @TimB99 ,

Please:
1. create a new measure:

 

Max count = 
VAR __max_count = MAXX(SUMMARIZE(ALL('Projects'),'Projects'[location],"@count",[project_count]),[@count])
RETURN __max_count

 

2. create a new table:

 

Table = GENERATESERIES(1,[Max count],1)

 

3. create a new measure:

 

Amount of locations = 
VAR __summary_table_1 = SUMMARIZE('Projects','Projects'[location],"@count",[project_count])
VAR __summary_table_2 =  SUMMARIZE(__summary_table_1,[@count],"@amount of locations",DISTINCTCOUNT(Projects[location]))
VAR __cur_count = SELECTEDVALUE('Table'[Value])
VAR _result = MAXX(FILTER(__summary_table_2,[@count]=__cur_count),[@amount of locations])
RETURN
_result

 

Output:

vcgaomsft_1-1708654865243.png

vcgaomsft_3-1708654915015.png

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 @v-cgao-msft

Thanks for the clear solution, this indeed fixed my problem. I tried similar things before but always forgot at least one step haha. I've accepted your reply as a solution. 
Cheers! 

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.