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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
smohapatra
Regular 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
MFelix
Super User
Super User

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

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

4 REPLIES 4
v-huizhn-msft
Microsoft Employee
Microsoft Employee

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

Thanks Mfelix,

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

 

Regards,

Shakti

@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)

MFelix
Super User
Super User

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

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors