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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
ChrisPala
Regular Visitor

Conditional axis value based on selected value

I am trying to produce a series of charts for benchmarking site performance between customers.

When presenting the information to a customer, I need to be able to show their performance vs other sites in an anonymised fashion.

In other words, I want to be able to conditionally show the name of the customer's site but display an alias for the other sites. 

 

I was hoping to drive this from a filter selection: select the customer name and have the charts dynamically change the axis values. So far I have managed to get this approach to work for formatting (I can display the customer's data in a different color to the rest); really I would love to have the names show as well. 

 

Given I can't add a measure to an axis, and calculated columns don't recompute when filter selections change, is there any alternative approach anybody can think of to this problem that might be feasible?

 

See the example pictured, I would like to replace the site "alias" (i.e. 1007) with the actual site name when selected. At the moment all I can do is get the colors to change. 

If anyone has any suggestions, I need to either:

- Display the name of the selected site only in the axis OR

- Hide the site indexes altogether whilst still retaining the year

ChrisPala_2-1715564250644.png

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @ChrisPala 

 

@johnbasha33 Thank you very much for your prompt reply. Allow me to add something here.

 

Your understanding is correct, the measure really don't work on the axes.

 

If you can, I recommend that you use another visualization object to display the results.

 

In order to create a measure, you need a virtual table as a slicer.

 

vnuocmsft_0-1715672277253.png

 

 

virtual table = VALUES('Table'[site name])

 

 

Create a measure.

 

 

hide site name = 
var _slicer = VALUES('virtual table'[site name])
RETURN
IF(
    ISFILTERED('virtual table'[site name]) && SELECTEDVALUE('Table'[site name]) in _slicer,
    SELECTEDVALUE('Table'[site name]),
    "xxx")

 

 

Note that for the site name I created the columns are formatted as text.

 

vnuocmsft_1-1715672417201.png

 

Here is the result.

vnuocmsft_2-1715672453984.png

 

Regards,

Nono Chen

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

3 REPLIES 3
Anonymous
Not applicable

Hi @ChrisPala 

 

@johnbasha33 Thank you very much for your prompt reply. Allow me to add something here.

 

Your understanding is correct, the measure really don't work on the axes.

 

If you can, I recommend that you use another visualization object to display the results.

 

In order to create a measure, you need a virtual table as a slicer.

 

vnuocmsft_0-1715672277253.png

 

 

virtual table = VALUES('Table'[site name])

 

 

Create a measure.

 

 

hide site name = 
var _slicer = VALUES('virtual table'[site name])
RETURN
IF(
    ISFILTERED('virtual table'[site name]) && SELECTEDVALUE('Table'[site name]) in _slicer,
    SELECTEDVALUE('Table'[site name]),
    "xxx")

 

 

Note that for the site name I created the columns are formatted as text.

 

vnuocmsft_1-1715672417201.png

 

Here is the result.

vnuocmsft_2-1715672453984.png

 

Regards,

Nono Chen

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

 

 

johnbasha33
Super User
Super User

Hi @ChrisPala  use the measure in visual and custom slicer selection
Site Name =
IF (
SELECTEDVALUE ( Customer[Customer Name] ) = "Selected Customer Name",
"Actual Site Name",
"Alias"
)

 

 

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

Thanks very much John. Am I mistaken in thinking a measure cannot be used on an axis? I tried a similar approach to begin with and was not able to work out how to place the measure on the axis.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

Top Kudoed Authors