Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

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...
  • v-pnaroju-msft's avatar
    1 year ago

    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:

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

    Thank you.