The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hello everyone!
What I basically want to do is create a dynamic Y axis on a bar chart, where it changes based on a slicer selection or parameter click.
But I need to have two bars per X iteration, 2023 vs 2024.
I don't know If you can visualize what I want to do, but I created a mockup on paint since I can't disclose the info on the charts!
Solved! Go to Solution.
Hi! Just wanted to post here since I figured it out.
This is basically what I had, a few indicators as a parameter in Y axis, what I needed is each month to have two columns as years. What i figured was to use my Year column as another X axis. Thanks so much, even though I couldn't quite explain it😅
Hi Ritaf1983 ,thanks for the quick reply, I'll add more.
Hi @Henrique_Quint ,
Please correct me if I have misunderstood.
The Table data is shown below:
Please follow these steps:
1.Manually enter the following data and create table-to-table relationships
2.Use the following DAX expression to create a measure
Measure = CALCULATE(SUM('Table'[Value]),'Table'[Year] IN VALUES('Table (2)'))
3.Final output
Best Regards,
Wenbin Zhou
Hi @Henrique_Quint
To get the desired result you should create 2 measures for the current year and the previous :
Or to use the year as a legend and select by filter/slicer the wanted years :
The pbix with the example is attached.
For more specific suggestions:
please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.
How to Get Your Question Answered Quickly
If my answer was helpful please give me a Kudos and accept as a Solution.
Sorry if I made myself confusing to understand 😅
I have several KPI's (let's call them A, B and C) in measures (each one has one for total, one for 2024 and one for 2023), What I want to do is create a bar chart that has both 2023 and 2024 as Y axis (two columns), months as X axis and some sort of slicer or parameter that changes the Y axis for A, B or C while still keeping 2023 and 2024 as columns in Y axis and months in X axis!
Hi @Henrique_Quint
The explanation is even more confusing.
Since you're asking a question that is both logical and requires a demonstration, it's essential to ensure that whoever is trying to help can focus on finding a solution, rather than generating data and trying to guess your intent—something that often takes a lot of time, which most of us don’t have. The support here is voluntary, and we genuinely want to help, but time is a limited resource.
Therefore, for these types of questions, to get an accurate solution, it’s recommended to include a sample dataset and a sketch of the desired solution.
If the data is sensitive, you can simply create a file with a similar structure and a few dozen rows, just to give something to work with.
The PBIX file can be stored in a public cloud service, and you can share the link.
Hi! Just wanted to post here since I figured it out.
This is basically what I had, a few indicators as a parameter in Y axis, what I needed is each month to have two columns as years. What i figured was to use my Year column as another X axis. Thanks so much, even though I couldn't quite explain it😅