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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
HassanAshas
Helper V
Helper V

How to change between pie-charts with the change in user selection

I have a dataset like this, 

 

Emp CodeNameCompetencyPractice
1MattDataAI
2AveryDataAI
3AryubDataAnalytics
4JacobCloudAWS
5ZaraDataEngineering
6AliCloudDevOps
7JohnCloudDevOps
8AlishaMarketingServices
9NovakMarketingAdvertisement
10AlexHRHRBP
11EmmaHRRecruitment

 

I have one slicer which allows the user to select between different competencies. I also have a pie-chart that displays Total Employees per Competency., as shown in the following image, 

 

HassanAshas_0-1677910240409.png

What I need is, 

 

  • If the user has not selected any competency, Pie-chart should display Total Employees per Competency
  • If the user has selected any competency, Pie-chart should display Total Employees per Practice 

Is it possible to do in the Power BI? 

 

One solution I know of is to use buttons and bookmarks to navigate between different bookmarks, with each bookmark having a pie-chart against each competency selection. But I can't use this approach because of two reasons, 1) I can't place Buttons in a drop down slicer, which is a requirement for me. 2) Bookmarks can't be dynamic (so for example, if a new Competency comes in the data later on, that wil not be added automatically) 

Another solution I could think of is using Field Parameters but then the problem is, I could not find any way to control the value of Field Parameter using another slicer (which is what I want to) 

 

Can anyone help in this? Thanks

 

If you would like to download the Example Power BI Workbook, you may do so here: https://drive.google.com/file/d/1DnTGDlaiTqL5GsuAw6DHko0GqHCS3d3h/view?usp=sharing

4 REPLIES 4
ValtteriN
Super User
Super User

Hi,

One way to do this is to use ISFILTERED. So for example new_measure = IF(ISFILTERED(table[competency]), [Total Employees per Practice], [Total Employees per Competency])

ISFILTERED checks for any effective filters and then selects the corresponding result.

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi @ValtteriN  thanks a lot for the reply. 

 

Yes, ISFILTERED would work but can you tell me how would it work in this scenario? I am not trying to calculate Total Number of Employees per Competency/Practice, but instead I am trying to show the distribution of employees based upon their Competency/Practice in a pie-chart. 

 

Competency/Practice is being used in the Legend and the Total Employees measure is being used in the Values Field of the Pie-Chart. What I want is if a Competency is selected, then Practice should be used in the "Legend" field, and if no competency is selected, then "Competency" column should be used in the Legend field. 

 

Can you kindly help out as to how I can use your measure to dynamically control the Legend field's value? Thanks! 

Hi,

I now understand what you are trying to achieve. The functionality you are describing could perhaps be achieved with bookmarks combined with field parameters. However from the enduser perspective this interaction might be a bit odd. Meaning that if you select some value then without explanation dimension values would change. Instead of this I suggest using straight forward field parameters. So create a new field parameter with your dimension values [competency] and [practice] then place this as a separete slicer and use the parameter as legend. This way the risk of end users beign confused is low and the actual solution is easy to build.

e.g. here the legend uses dim2 values corresponding to my parameter selection.

ValtteriN_0-1678025685025.png

 







Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Yes, I understand from what you are coming in terms of being odd for end-user, but unfortunately (or fortunately, lol), in my case, the end-users are some very specific people (stakeholders) and they want an exactly similar kind of functionality as I mentioned.

 

They don't want an "increased number of click" to drill down into the second level 😅 and only want to be able to drill down by just selecting "any competency" (if you select any specific competency, pie-chart should show breakdown by practice, otherwise it should show breakdown by competency). Due to this reason, the approach of Field Parameters unfortunately don't work for me (because it will require them to select from another slicer/list) 

 

Combining Bookmarks with the field parameters also sadly don't work for me, because I don't have much space in my page to use Bookmarks for all the things (there are actually 4-5 levels in the report) and sadly, we still can't use Bookmarks in "Drop-down slicer". Also, bookmarks will remove the "dynamic" part of the data loading from the report as well (For example, if a new competency is added in future, we would have to add a bookmark for that specifically as well) 

 

Regardless, I am very thankful to you for taking time out and trying to show the best possible approach to this problem. Thank you

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors