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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
johnmelbourne
Helper V
Helper V

Conditional format bar chart by slicer selection

Hi,

 

I have the following design, and I want the specific provider's bar highlighted when selected in the slicer. 

At the moment I have the bar chart not filtering due to edit interactions turned off.

 

Is there a way to do this?

 

Any assistance greatly appreciated. PBIX file linked below.

 

Filename Size URL Expires at

conditionalformatbarchart.pbix
126.59 KB
https://tmpfiles.org/dl/953823/conditionalformatbarchart.pbix

2023-02-22 07:57 UTC

 

 

2.jpg

 

1 ACCEPTED SOLUTION
Arul
Super User
Super User

@johnmelbourne ,
refer video in this link:https://www.youtube.com/watch?v=DT3XTcXJxo4 

1. Create a duplicate table of the column which is using in the slicer.

Arul_0-1677068642715.png

2. Write the below measure,

Conditional Formatting = 
VAR _selectedBank = VALUES('Table 1 (Slicer)'[Bank])
VAR _result = IF(SELECTEDVALUE('Table 1'[Bank]) IN _selectedBank,1,0)
RETURN _result

3. In the slicer use the column from duplicated table i.e. from the slicer table,

Arul_1-1677069001660.png

4. Now bring the columns from source table for the visualization (bar chart),

Arul_2-1677070292542.png

5. Now click on any of the values in the slicer would make the bar chart interactive,

Arul_3-1677072117428.png

Thanks,

Arul

 

 

 

 





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

Proud to be a Super User!


LinkedIn


View solution in original post

2 REPLIES 2
johnmelbourne
Helper V
Helper V

Thanks for your reply, worked execellently to format the bars in the visual.

Then just had to create a new measure for the visual I wanted to filter such as:

Total complaints (disconnected) using VALUES =

    VAR SelectedProviders = VALUES(Slicer[Provider])
RETURN
    CALCULATE(
        [Total complaints],
        FILTER(
            Data,
            Data[Provider] IN SelectedProviders
        )
    )
 
To use the value in the disconnected slicer to create a "filtered" result in the other visual.
 
Many thanks again @Arul 

 

Arul
Super User
Super User

@johnmelbourne ,
refer video in this link:https://www.youtube.com/watch?v=DT3XTcXJxo4 

1. Create a duplicate table of the column which is using in the slicer.

Arul_0-1677068642715.png

2. Write the below measure,

Conditional Formatting = 
VAR _selectedBank = VALUES('Table 1 (Slicer)'[Bank])
VAR _result = IF(SELECTEDVALUE('Table 1'[Bank]) IN _selectedBank,1,0)
RETURN _result

3. In the slicer use the column from duplicated table i.e. from the slicer table,

Arul_1-1677069001660.png

4. Now bring the columns from source table for the visualization (bar chart),

Arul_2-1677070292542.png

5. Now click on any of the values in the slicer would make the bar chart interactive,

Arul_3-1677072117428.png

Thanks,

Arul

 

 

 

 





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

Proud to be a Super User!


LinkedIn


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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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