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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
pbiforum_123
Helper III
Helper III

Dynamic Dimension in Bar Chart x-axis

Below measue works when use this as a measure in the y-axis but I am not able to figure it out how to use similar thing for a dimension in x-axis. I want to achieve this without using field parameter.

 

I want to use the below dimension dynamically. 

 

Fact1[Year]

Fact2[Year]

 

DynamicMeasure =
SWITCH(
TRUE(),
SELECTEDVALUE(Slicer1Options[Option]) = "Option A" && SELECTEDVALUE(Slicer2Options[Option]) = "Option X", [MeasureAX],
SELECTEDVALUE(Slicer1Options[Option]) = "Option A" && SELECTEDVALUE(Slicer2Options[Option]) = "Option Y", [MeasureAY],
SELECTEDVALUE(Slicer1Options[Option]) = "Option B" && SELECTEDVALUE(Slicer2Options[Option]) = "Option X", [MeasureBX],
SELECTEDVALUE(Slicer1Options[Option]) = "Option B" && SELECTEDVALUE(Slicer2Options[Option]) = "Option Y", [MeasureBY],
BLANK()
)

 

I wanted to use like below i am not able to use the dimension, i can use only measure

 

SelectedDimension =
SWITCH (
    SELECTEDVALUE ('Threshold Unit'[Threshold Unit])="Value Based",Fact1[Year],
       SELECTEDVALUE ('Threshold Unit'[Threshold Unit])="Volume Based",Fact2[Year],
    BLANK ()
)
1 ACCEPTED SOLUTION
v-pnaroju-msft
Community Support
Community Support

Thankyou, @danextian, for your response.

Hi pbiforum_123,

We appreciate your question on the Microsoft Fabric Community Forum.

From what I understand, you want to switch the X-axis between Fact1[Year] and Fact2[Year] based on a slicer selection, but without using Field Parameters. Since Power BI does not allow changing the X-axis dimension dynamically using only DAX, we have implemented a workaround using data modeling.

Kindly find the steps below to resolve the issue:

  1. Combine Fact1 and Fact2 tables using Power Query Append Queries to create a single table.
  2. Create a slicer using a Threshold Unit table.
  3. Use a DAX measure to filter data according to the slicer selection.
  4. Plot Year on the X-axis and the filtered Sales measure on the Y-axis.

This way, you can switch the dimension dynamically without using Field Parameters.

Please see the attached screenshot and sample pbix file for your reference:

vpnarojumsft_0-1751885457824.png

We hope this helps you solve the issue. If you have any more questions, feel free to ask the Microsoft Fabric community.

Thank you.

View solution in original post

7 REPLIES 7
v-pnaroju-msft
Community Support
Community Support

Hi pbiforum_123,

We are following up to see if your query has been resolved. Should you have identified a solution, we kindly request you to share it with the community to assist others facing similar issues.

If our response was helpful, please mark it as the accepted solution, as this helps the broader community.
Should you have any further queries, kindly feel free to contact the Microsoft Fabric community.

Thank you.

v-pnaroju-msft
Community Support
Community Support

Hi pbiforum_123,

We would like to know if the details we shared have helped solve your problem. If you require any additional assistance, feel free to connect with the Microsoft Fabric community.

Thank you.

v-pnaroju-msft
Community Support
Community Support

Hi pbiforum_123,

We would like to follow up and see whether the details we shared have resolved your problem.
If you need any more assistance, please feel free to connect with the Microsoft Fabric community.

Thank you.

v-pnaroju-msft
Community Support
Community Support

Thankyou, @danextian, for your response.

Hi pbiforum_123,

We appreciate your question on the Microsoft Fabric Community Forum.

From what I understand, you want to switch the X-axis between Fact1[Year] and Fact2[Year] based on a slicer selection, but without using Field Parameters. Since Power BI does not allow changing the X-axis dimension dynamically using only DAX, we have implemented a workaround using data modeling.

Kindly find the steps below to resolve the issue:

  1. Combine Fact1 and Fact2 tables using Power Query Append Queries to create a single table.
  2. Create a slicer using a Threshold Unit table.
  3. Use a DAX measure to filter data according to the slicer selection.
  4. Plot Year on the X-axis and the filtered Sales measure on the Y-axis.

This way, you can switch the dimension dynamically without using Field Parameters.

Please see the attached screenshot and sample pbix file for your reference:

vpnarojumsft_0-1751885457824.png

We hope this helps you solve the issue. If you have any more questions, feel free to ask the Microsoft Fabric community.

Thank you.

danextian
Super User
Super User

Hi @pbiforum_123 

 

From the looks of it, you're trying to create a calculated column using a slicer selection from SelectedDimension. That won’t work as calculated columns (and tables) don’t respond to slicers. Their values are fixed when the data is loaded or refreshed, so they won’t update based on user selections.

 

We may be able provide you with a workaround  but we need a sample data (not an image), your expected result from the same sample data and your reasoning behind. You may post a link to Excel or a sanitized copy of your PBIX stored in the cloud.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

@danextian I am not creating the calculated column. It is a direct column from a table only. Based on the selectedvalue of a slicer i wanted to control the dimension.

You are trying to switch between dimensions using DAX exression which is not possible. Values from both columns must exist in a single column with another column to identify which row goes to a specific slicer selection. Please refer to @v-pnaroju-msft's response. This should be possible though and pretty simple with Field Parameters - Let report readers use field parameters to change visuals (preview) 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors