cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper II
Helper II

Toggle Axis by a slicer

I have a table of sales below

 

Details

Client NameStatusStaffSupervisor
Test1CompletedArthur MorganDutch van der Linde
Test2PendingMicah Bell Karen Jones
Test3PendingArthur MorganKaren Jones

 

I wanna see how many Staff and supervisor are still on pending.

I have created another table which holds the word staff and supervisor and created a switch statement

 

RankTable

 

Switch(TRUE()
    ,Values('RankTable'[Rank])="Supervisor",[Number of Supervisor]
    ,Values('RankTable'[Rank])="Staff",[Number of Staff]
  
    ,blank())

 

 

Measure: Number of Supervisor

 

Number of Supervisor= DISTINCTCOUNTNOBLANK('Details'[Supervisor])

 

Measure: Number of Staff

 

Number of Staff= DISTINCTCOUNTNOBLANK('Details'[Staff])

 

 

 

Output will have a bar chart which x axis depends on the switch between view of staff or supervisor and will show how count of staff who still has pending status.

4 REPLIES 4
Microsoft
Microsoft

Hi, @Kalachuchi 

 

According to your description,I think you can modify your measure and use it in bar chart 'values'.

Like this:

Measure 2 = IF(SELECTEDVALUE(RankTable[Rank])="Supervisor",[Number of Supervisor],[Number of Staff])

9.png

8.png

If it doesn’t solve your problem, please feel free to ask me.

 

Best Regards

Janey Guo

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Super User IV
Super User IV

@Kalachuchi , On of the option for that is bookmarks and buttons

https://radacad.com/bookmarks-and-buttons-making-power-bi-charts-even-more-interactive

 

Others Dynamically change chart axis in Power BI
https://www.youtube.com/watch?v=6jeSIRpjv0M
https://datamonkeysite.com/2020/10/22/change-dimension-dynamically-using-parameter-in-powerbi/



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

@amitchandak ,bookmarks and button is what I was thinking but I have 3 more slicer so when there is already an active option on the other 3 slicer and user clicked the button slicer will reset everything.

@Kalachuchi , If you can add a direct Query table and test this

https://datamonkeysite.com/2020/10/22/change-dimension-dynamically-using-parameter-in-powerbi/



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Helpful resources

Announcements
secondImage

Happy New Year from Power BI

This is a must watch for a message from Power BI!

December Update

Check it Out!

Click here to read more about the December 2020 Updates!

Community Blog

Check it Out!

Click here to read the latest blog and learn more about contributing to the Power BI blog!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors