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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
eliasayyy
Memorable Member
Memorable Member

Dynamic X-axis on Column Chart based on selection

hello everyone i have 2 tables

product analysis and campaign analysis

i made a field parameter table including the measures from both product and campaign 

some measures from product : "Adds to Cart " , "Checkouts" , "Revenues" 

some measures from Campaign : "Bounces" , "Sessions"...

i added a slicer that will allow the user to select the measure they want to see

my goal is i want to know if its possible to have a dynamic x-axis that if the client selects "Add to Carts" measure on the slicer, the axis will show the products distribution while if they choose the "Bounces" measure on the slicer, they axis will shift to showing by campaign distribution

is this possible?

@tamerj1 @johnt75 @amitchandak @FreemanZ @v-yueyunzh-msft 

1 ACCEPTED SOLUTION

i did it kinda, i made a new field parameter called "X-axis Paramter" and added the fields "Campaign" and "Product"

but since my fields parameter for the measures has 11 measures and order from 0 to 10

i had to do this

 

GA X-Axis Slicer = {
    ("Campaign", NAMEOF('Campaign Analysis'[Campaign]), 0),
    ("Campaign", NAMEOF('Campaign Analysis'[Campaign]), 1),
    ("Campaign", NAMEOF('Campaign Analysis'[Campaign]), 2),
    ("Campaign", NAMEOF('Campaign Analysis'[Campaign]), 3),
    ("Campaign", NAMEOF('Campaign Analysis'[Campaign]), 4),
    ("Campaign", NAMEOF('Campaign Analysis'[Campaign]), 5),
    ("Campaign", NAMEOF('Campaign Analysis'[Campaign]), 6),
    ("Product", NAMEOF('Product Analysis'[Product]), 7),
    ("Product", NAMEOF('Product Analysis'[Product]), 8),
    ("Product", NAMEOF('Product Analysis'[Product]), 9),
    ("Product", NAMEOF('Product Analysis'[Product]), 10)
}

 

 

then make a relationship between order column of x-axis and order column of measure parameter.

so now when i select the measure from the slicer 
it will return the x-axis desired.

it works perfectly but i would like to know if there is a better more effiecent way to do it because what if i had many more measures 

View solution in original post

4 REPLIES 4
tamerj1
Super User
Super User

Hi @eliasayyy 
Probably can be done but you need to share a sample file.

i did it kinda, i made a new field parameter called "X-axis Paramter" and added the fields "Campaign" and "Product"

but since my fields parameter for the measures has 11 measures and order from 0 to 10

i had to do this

 

GA X-Axis Slicer = {
    ("Campaign", NAMEOF('Campaign Analysis'[Campaign]), 0),
    ("Campaign", NAMEOF('Campaign Analysis'[Campaign]), 1),
    ("Campaign", NAMEOF('Campaign Analysis'[Campaign]), 2),
    ("Campaign", NAMEOF('Campaign Analysis'[Campaign]), 3),
    ("Campaign", NAMEOF('Campaign Analysis'[Campaign]), 4),
    ("Campaign", NAMEOF('Campaign Analysis'[Campaign]), 5),
    ("Campaign", NAMEOF('Campaign Analysis'[Campaign]), 6),
    ("Product", NAMEOF('Product Analysis'[Product]), 7),
    ("Product", NAMEOF('Product Analysis'[Product]), 8),
    ("Product", NAMEOF('Product Analysis'[Product]), 9),
    ("Product", NAMEOF('Product Analysis'[Product]), 10)
}

 

 

then make a relationship between order column of x-axis and order column of measure parameter.

so now when i select the measure from the slicer 
it will return the x-axis desired.

it works perfectly but i would like to know if there is a better more effiecent way to do it because what if i had many more measures 

@eliasayyy 
Actually this is what I had in mind 😄

I was just afraid that adding the new relationships will create ambiguity as I have no idea how your data model look like.

oh well in that case thank you very much for the help

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.