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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply

Change color icons based on the slicer selection

Hi Experts,

 

I am working on the requirements below to showcase the individual data when we select any options in slicer.

 

(ACCOUNT)(OFFER TYPE)(SCOPE)(SCOPE COMBINED)(FORECAST)(REVENUE)(CM%)
AAAXREDRED44535445436735%
AAAYGREENRED8676976435%
BBBYAMBERAMBER12344597676535%
BBBXGREENAMBER335558765435%

 

above the sample data , in that SCOPE and SCOPE COMBINED columns are calculated columns which we have developed already to display the risks in color icons .
We have a OFFER TYPE slicer in the page and In the slicer we have offer types (eg : X , Y , etc) When slicer OFFER TYPE is "ALL" then we can show combined row as below :

 

AccScope Comb.forecastrevenueCM%
AAARED454030 (sum of both AAA account forecast values)46413135%
BBBAMBER..........35%


but when we select some selection from the slicer (X or Y) then it should show only specific respective row data .
Example : when i select "X" in the slicer , the table should show only X related data in the table expected as below : (removed OFFER TYPE & SCOPE columns)

ACCOUNTSCOPE COMBINEDFORECASTREVENUECM%
AAARED44535445436735%
BBBGREEN335558765435%


Scope combined DAX we created :

Scope Combined =
VAR A = 'Test Delivery Updates'[Account Name]
VAR B = ADDCOLUMNS(SUMMARIZE(FILTER('Test Delivery Updates','Test Delivery Updates'[Account Name]=A),'Test Delivery Updates'[Scope logic]),"Scope",SWITCH('Test Delivery Updates'[Scope logic],"Red",3,"Amber",2,"Green",1,0))
RETURN MAXX(TOPN(1,B,[Scope]),'Test Delivery Updates'[Scope logic])

 

So far the combined rows are working fine when OFFER TYPE is "ALL" , so we want to fix the single offer type selection from the slicer.

dinesharivalaga_0-1730785541776.png


Hope it is clear .. let me know if require more data.

Thanks

DK

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

Hi ALL
Firstly  Ankur04 thank you for your solution!

And @dinesharivalaga ,You want to show the value of the scope combine in the case of multi-selection, and the value of the scope in the case of single-selection, right?
If that's the case, we can create a new metric to determine whether we're multi-selecting or single-selecting to determine how we need to format the output.

Dynamic Scope = 
IF(
    ISFILTERED('Test Delivery Updates'[Offer Type]) && HASONEVALUE('Test Delivery Updates'[Offer Type]),
    MAX('Test Delivery Updates'[Scope]), 
    MAX('Test Delivery Updates'[Scope Combined])
)

vxingshenmsft_0-1730859102889.png

If you still have questions, check out my pbix file, I hope my solution helps, I would be honored if I could solve your problem!

Hope it helps!

Best regards,
Community Support Team_ Tom Shen

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

6 REPLIES 6
v-xingshen-msft
Community Support
Community Support

Hi ALL
Firstly  Ankur04 thank you for your solution!

And @dinesharivalaga ,You want to show the value of the scope combine in the case of multi-selection, and the value of the scope in the case of single-selection, right?
If that's the case, we can create a new metric to determine whether we're multi-selecting or single-selecting to determine how we need to format the output.

Dynamic Scope = 
IF(
    ISFILTERED('Test Delivery Updates'[Offer Type]) && HASONEVALUE('Test Delivery Updates'[Offer Type]),
    MAX('Test Delivery Updates'[Scope]), 
    MAX('Test Delivery Updates'[Scope Combined])
)

vxingshenmsft_0-1730859102889.png

If you still have questions, check out my pbix file, I hope my solution helps, I would be honored if I could solve your problem!

Hope it helps!

Best regards,
Community Support Team_ Tom Shen

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

 

 

@v-xingshen-msft  Thanks a lot for your solution 🙂

This is the expectation from my end 🙂

Ankur04
Resolver II
Resolver II

Hi @dinesharivalaga ,

 

could you please explain in detials with your raw data and expected output. I tried to understand from the above query your calculation by default should work.

 

Thanks,

 

Ankur

@Ankur04 

Offer type and scope logic columns are not required in this table , i just added for the understanding.
when we select offer type options in the slicer then the scope logic icon (green) should display in the scope combined column , this is the expected result .

dinesharivalaga_0-1730791971880.png

 

dinesharivalaga_1-1730792088785.png

 

Hi @dinesharivalaga ,

 

can you try something like this. 

 

Scope_Combine = CALCULATE(MAX('Table (9)'[(SCOPE)]),'Table (9)'[(OFFER TYPE)] = SELECTEDVALUE('Table (9)'[(OFFER TYPE)])) 
 
you can modify it based on some condition.if this is not your expectation then please help me to understand more about your requirement.
 
Thanks,
 
Ankur
 
 

@Ankur04  Sorry i don't understand this .. Can you please explain what you are trying to say ?

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.