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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
eliasayyy
Super User
Super User

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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