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
Anonymous
Not applicable

Bar Chart colour based on Table

Hi,

 

I have a Table showing what versions of software are approved and a Bar Chart showingwhat is actually installed on the user's device. I would like to change the colour of this bar to get it to stand out. Is this possible? Driving me mad!

 

PowerBI Question.PNG

 

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

HI @Anonymous,

Maybe you can try to use the following measure formula on data color formatting to highlight the records that existed in your Approved Software Versions tables:

Measure =
VAR selected =
    ALLSELECTED ( 'Approved Software Versions'[iOS] )
VAR currVersion =
    SELECTEDVALUE ( 'Purchased App Versions'[iOS Version] )
RETURN
    IF ( currVersion IN selected, "Red", "Blue" )

9.png

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

9 REPLIES 9
v-shex-msft
Community Support
Community Support

HI @Anonymous,

Maybe you can try to use the following measure formula on data color formatting to highlight the records that existed in your Approved Software Versions tables:

Measure =
VAR selected =
    ALLSELECTED ( 'Approved Software Versions'[iOS] )
VAR currVersion =
    SELECTEDVALUE ( 'Purchased App Versions'[iOS Version] )
RETURN
    IF ( currVersion IN selected, "Red", "Blue" )

9.png

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

Hi @v-shex-msft  - Thank you so much for your help with this, this is exactly what I was after! 

dedelman_clng
Community Champion
Community Champion

Hi @Anonymous - you can try something like this.  There are probably more elegant ways to do it, but this should work

 

Create a Measure 

 

Highlight =
VAR __myVer =
    SELECTEDVALUE( Table[iPadOSVer] )
VAR __myAppVal =
    LOOKUPVALUE ( Table2[Approved Version}, Table2[OS], "iOS")
RETURN
    IF ( __myDt = __myAppVal, 1, 0 )

 

Then do conditional formatting on your bars using Rules.  When Highlight is 1 use your highlight color, else use your default color.

 

Hope this helps

David

Anonymous
Not applicable

Hi David (@dedelman_clng )

Thanks for sharing this, I have tried to add this measure but am getting the error below, any ideas please? (Sorry didn't realise this would take me to bits that I have never done before, which I like!)

Measure Issue.PNG

Thanks!

Hi @Anonymous  - "highlight" was the name of my measure, not a DAX command. Sorry for the confusion. 

Also check on the LOOKUPVALUE statement. It needs at least 3 parameters

 

LOOKUPVALUE (Column to Return, Column to match, Value to Match)

 

MeasureName =
VAR __myVer =
    SELECTEDVALUE( Table[iPadOSVer] )
VAR __myAppVal =
    LOOKUPVALUE ( Table2[Approved Version}, Table2[OS], "iOS")
RETURN
    IF ( __myVer = __myAppVal, 1, 0 )

David

PaulDBrown
Community Champion
Community Champion

@Anonymous 

It sure is possible, but it is hard to suggest a solution based on the info you have provided. Can you share an example with dummy data, or even a PBIX file?





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Anonymous
Not applicable

Hi @PaulDBrown - Please can you suggest how I can share this file with you? The only way I can see is to use a Shared OneDrive folder? Thanks for your help!

@Anonymous 

Yes, use Onedrive (or any other cloud service) to upload the file and share from there





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Anonymous
Not applicable

Hi @PaulDBrown ,

Please see this folder containing an excel with both tables in on seperate sheets:

 

https://1drv.ms/u/s!AgPjQo5LA9hIex6kI2rMczZFfdQ?e=3hTsYM 

 

Thanks again for your help!

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

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.