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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
rishikhurana
Regular Visitor

Dynamic x axis numbering based on filtering

Hi Everyone,

 

I am very new to the Power Bi (literally 4 day old). I need to make two graphs which are based on 7-8 filters/slicers. Current selection shows you 8 filtered clients. Graph to the left is fine and I want to keep it that way with client names however, graph to the right I want to disguise the client name and name them

Peer1, Peer2, Peer3 so on till Peer8 in this case.

 

Check.jpg

However, the best I could do is to use Rankx formula below in a new measure and use this to create column using concatenate(Peer&Ranking). But as can be seen in the image, the rank is given to all the 43 rows and doesnt dynamically change with chosen filters. 

 
Ranking =
RANKX(ALLSELECTED('Program Level Data'),
'Program Level Data'[Key],
MAX('Program Level Data'[Key])
)

 

I am pretty sure there is a way to do this job and I can see number of peers based on number of selected data (8 in above scenario), please help.

 

Also, next step would be to make a toggle switch and keep just one graph, and switch between these two views within a graph.

#rankx #slicer #filter #powerbi #dataquery #graph #dynamic

 

Please support. Thanks in advance.

Rishi

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

HI @rishikhurana,

Perhaps you can take a look at the following blog to use the 'unpivot columns' feature to create a dynamic attribute report:

Dynamic Attributes In A Power BI Report - P3 Adaptive

Regards,

Moonlight

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

HI @rishikhurana,

Perhaps you can take a look at the following blog to use the 'unpivot columns' feature to create a dynamic attribute report:

Dynamic Attributes In A Power BI Report - P3 Adaptive

Regards,

Moonlight

PaulDBrown
Community Champion
Community Champion

What slicers are you using? How many "Peers" do you need? Is there a particular reason why the axis has to be 1, 2, 3, 4.... and not 2,6,8,10....?





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






PaulDBrown
Community Champion
Community Champion

Calculated columns are not dynamic. They are calculated when the model is loaded. If you want the top 8, there  is an option in the filter pane for the visual. In the filter pane, for the Peer column choose TopN from the deopdown, type in 8 and add the measure you have in the visual for the TopN calculation ("Based on" I think it's called in the filter options -I'm not in front of a pc now so can't check the exact expression)





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Thank you Paul for your reply. However, I dont need TopN here, what i need is to name the bars as 1,2,3, so on. based on the selections made. Just need to hide the names ABC, DEF, GHI etc, basically if presenting this dashboard to the client ABC, we dont have to identify DEF, GHI etc but just as other normal peers. Hope it clarifies. Thanks!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.