cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
HassanAli123
Helper I
Helper I

change the color of card on selection of bar chart which is using measure

Hi,

    i want to change the background color of card on selection of bar chart which is using measure not colum.

   i used below Dax

    if(isfiltered(Table[Column]) , "Green", "Blue")

   But the issue is i have measure not colum. measure is not allowed in filter function. how can i solve it.

    i have attached a picture for your refference

     Capture.PNG

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@HassanAli123 , Take a dummy column, We can not capture the click of measure.

Create a table with single column using enter data and use that as axis

 

 

Else give button use bookmark and button

View solution in original post

v-cgao-msft
Community Support
Community Support

Hi @HassanAli123 ,

 

Please create a new single-column table.

vcgaomsft_0-1645667774932.png

And put it into the axis of the bar chart.

vcgaomsft_1-1645667909840.png

Create a measure.

 

colour = IF(ISFILTERED('Table'[Column1]),"Green","Red")

 

When you click on the bar, the color of the card changes to green.

vcgaomsft_2-1645668314043.png

Attach the pbix file for reference. Hope it helps.

 

Best Regards,
Community Support Team_Gao


If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

View solution in original post

2 REPLIES 2
v-cgao-msft
Community Support
Community Support

Hi @HassanAli123 ,

 

Please create a new single-column table.

vcgaomsft_0-1645667774932.png

And put it into the axis of the bar chart.

vcgaomsft_1-1645667909840.png

Create a measure.

 

colour = IF(ISFILTERED('Table'[Column1]),"Green","Red")

 

When you click on the bar, the color of the card changes to green.

vcgaomsft_2-1645668314043.png

Attach the pbix file for reference. Hope it helps.

 

Best Regards,
Community Support Team_Gao


If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

amitchandak
Super User
Super User

@HassanAli123 , Take a dummy column, We can not capture the click of measure.

Create a table with single column using enter data and use that as axis

 

 

Else give button use bookmark and button

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors