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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
v-nuoc-msft
Community Support
Community Support

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
v-nuoc-msft
Community Support
Community Support

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
Solution Sage
Solution Sage

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.