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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
TattyPattyMatty
Regular Visitor

How to show different column values in y-axis based on slicer choice while x axis remains stable

Hey everyone,

 

I am confronted with a problem, to which I could not really find an appropriate solution.  I will try to simply my question.

 

So I have a table with the following columns: 

Country,

Month,

Expenditure, 

CountryExpCummu. (This is a DAX column where I calculate the monthly cummulated sum of Expenditure of each country),

AllExpCummu. (This is a DAX column where I calculte the monthly cummulated sum of Expenditure of all the countries)

 

Then, I want to visualize these data in bar chart and here is the function I want it to fulfill:  
I add the [Country] column as the slicer,  [Month] as the x axis . When I choose a specific country in the slicer, the y axis will show the maximum of the values in [CountryExpCummu.] in each month ;  When I don't choose any country in the slicer, the y axis will correspondently show the maximum of values in [AllExpCummu] in each month.

 

(Here is the thing that might need attention:  Since each country has multiple expenditures in each month, therefore, when I calculate the cummulated sum of each country in [CountryExpCummu.] as well as of all countries in [AllExpCummu.] , some same values will be shown in every line that contains the same country and month. That is why I mention that I want the y axis only to show the maximum of relevant value of each country in each month, not the sum)

 

Would anyone be kind enough to provide me with an solution? This is sort of like "dynamically changing the axis value" problem but not exactly the same since the x axis remains the same, which shows [Month] from beginning to the end while y axis switches dynamically between two columns based on the choice in the slicer.

3 REPLIES 3
TattyPattyMatty
Regular Visitor

Hi everyone,

 

I think the main bottleneck here is how to realize the function where the y-axis could vary between different values from different columns based on the action on the slicer  while keeping the x-axis stable 

Uzi2019
Super User
Super User

Hi @TattyPattyMatty 
If you want dynamic slicer please check this video

https://www.youtube.com/watch?v=-nqEv2YXLsU

 

https://www.youtube.com/watch?v=nWgPynP9XDM

 

I Hope above video would help you to solve your issue!

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

I'm sorry this is not exactly what I need but thanks anyway😉

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.