cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
smohapatra Frequent Visitor
Frequent Visitor

How to show different field value based on Slicer select/deselect

Hi ,

 

I have a slicer say organization name and I have a history trending visual which has a KPI value for last 6 months. This KPI value is from a table where I am calculating the same based on different organization as group by and also I am calculating the KPI value for overall (note the calcuations for overall and individual organization is slightly different in nature) . Now I want my history trending visual to display overall value of the KPI when there is no selection in organization slicer then the value should be correspoding to overall and when there is any individual organization slicer is selected then it should display the value for corresponding L3.

 

Second part is already done as it is already calculated in table, But the first part is I am anot sure how to achieve ? Please let me know if anybody has any idea ?

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: How to show different field value based on Slicer select/deselect

Hi @smohapatra,

 

I believe that you can achieve that with the SWITCH formula, since you have different measures for organizational and Individual you can use something like this:

 

KPI_Value =SWITCH(
                                  TRUE();
                                      CALCULATE(
                                            DISTINCTCOUNT(Table1[Company]); 
                                            ALLSELECTED(Table1[Company]))>1;
                                 [OVERALL_MEASURE];
                                 [INDIVIDUAL_MEASURE])

I assume that you only want to have one value in the slicer that's why I look at greater than 1 to return the Overall, if you need to have the single value for more than one choice you can use this one:

 

KPI_Value =SWITCH(
                                  TRUE();
                                      CALCULATE(
                                            DISTINCTCOUNT(Table1[Company]); 
                                            ALLSELECTED(Table1[Company]))=
                                            CALCULATE(
                                            DISTINCTCOUNT(Table1[Company]); 
                                            ALL(Table1[Company]));
                                 [OVERALL_MEASURE];
                                 [INDIVIDUAL_MEASURE])

 

I don't know if  you have a separate table for the slicer or it's on the Dataset as one table but the distinctcount must be done in the table were you have the slicer allocated.

 

This formula was done only with a simple table with companies and count of companies no other information but should work with different setups also.

 

Regards,

MFelix

 



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

Proud to be a Datanaut!




View solution in original post

4 REPLIES 4
Super User
Super User

Re: How to show different field value based on Slicer select/deselect

Hi @smohapatra,

 

I believe that you can achieve that with the SWITCH formula, since you have different measures for organizational and Individual you can use something like this:

 

KPI_Value =SWITCH(
                                  TRUE();
                                      CALCULATE(
                                            DISTINCTCOUNT(Table1[Company]); 
                                            ALLSELECTED(Table1[Company]))>1;
                                 [OVERALL_MEASURE];
                                 [INDIVIDUAL_MEASURE])

I assume that you only want to have one value in the slicer that's why I look at greater than 1 to return the Overall, if you need to have the single value for more than one choice you can use this one:

 

KPI_Value =SWITCH(
                                  TRUE();
                                      CALCULATE(
                                            DISTINCTCOUNT(Table1[Company]); 
                                            ALLSELECTED(Table1[Company]))=
                                            CALCULATE(
                                            DISTINCTCOUNT(Table1[Company]); 
                                            ALL(Table1[Company]));
                                 [OVERALL_MEASURE];
                                 [INDIVIDUAL_MEASURE])

 

I don't know if  you have a separate table for the slicer or it's on the Dataset as one table but the distinctcount must be done in the table were you have the slicer allocated.

 

This formula was done only with a simple table with companies and count of companies no other information but should work with different setups also.

 

Regards,

MFelix

 



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

Proud to be a Datanaut!




View solution in original post

Microsoft v-huizhn-msft
Microsoft

Re: How to show different field value based on Slicer select/deselect

Hi @smohapatra,

After review, please try to create measure based on @MFelix posted, and check if it works fine.

If you still have not resolved your issue, please post some sample date for further analysis, so that we can post solution which is close to your requirement.

Thanks,
Angelia

smohapatra Frequent Visitor
Frequent Visitor

Re: How to show different field value based on Slicer select/deselect

Thanks Mfelix,

For your  inputs. I am trying the solution provided by MFelix. I will try and let you know.

 

Regards,

Shakti

smohapatra Frequent Visitor
Frequent Visitor

Re: How to show different field value based on Slicer select/deselect

@MFelix, Thanks the solution worked. I used a IF condition and as I was having more than one organization so the conditions was something like as below :

 

KPI = IF(DISTINCTCOUNT(Table[Org])>number of Org,Overall Measure,Org Measure)

Helpful resources

Announcements
New Kudos Received Badges Coming

New Kudos Received Badges Coming

Kudos to you if you earned one of these! Check your inbox for a notification.

Microsoft Implementation for Communities Wins Award

Microsoft Implementation for Communities Wins Award

Learn about the award-winning innovation that was implemented across Microsoft’s Business Applications Communities.

Power Platform World Tour

Power Platform World Tour

Find out where you can attend!

Top Kudoed Authors (Last 30 Days)
Users online (3,831)