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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Radhika2605
Helper II
Helper II

Help with a visual

Hi Everyone!

 

I am working on a Restaurant data and I have three types of ratings - Overall, Service and Food Ratings. I have created three different visuals currently to show the ratings per city level as shown below:

Radhika2605_0-1630478157539.png

 

 

The ratings are in a table called Rating and the columns are - Restaurant id, Customer Id, Overall Rating, Food Rating and Service Rating. 

 

What I want to achieve is instead of having these three visuals, I want to just have one visual and one slicer where when I select Food from Slicer then I can see data related to food ratings, when I select overall slicer then I can see data related to overall settings in the visual and so on.

 

I have created a slicer already by using Enter data function and creating a table but I dont know how should I create a measure (I want to use Dax to achieve this) which will allow me to display whatever rating I have selected on the slicer in visual. 

 

My model looks like this

Radhika2605_1-1630478263448.png

 

 

Could someone please help?

 

Thanks

Radhika

7 REPLIES 7
PaulDBrown
Community Champion
Community Champion

Create a new table using:

Rating Slicer = {"Overall rating", "Food rating", "Service rating"}

Leave this table unrelated in the model.

Create a measure along the lines of:
Selected Parameter = SWITCH(TRUE(),
SELECTEDVALUE(Rating Slicer[Value]) = "Overall rating", [Your overall rating measure],

SELECTEDVALUE(Rating Slicer[Value]) = "Food rating", [Your food rating measure],

[Your service rating measure])

 

Now create the visual with this [Selected Parameter] measure and a slicer using the field from the Rating Slicer table.





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.






Hi @PaulDBrown ,

 

Thanks for your response. I actually made a similar measure for another visual using the same technique which you suggested. But this time the problem is that Overall, Service and Food Ratings are not measures but columns of my Ratings table. Hence I dont know how to use this. 

Radhika2605_0-1630556217661.png

 

 

If you could suggest how should I change this measure so that I can get the column as these are not measures for me would be great! Appreciate your help!

 

Thanks

Radhika

 

Can't you just create measures along the lines of:

Overall rating = SUM(Rating[Overall_rating])

?





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 

Sadly no as this is the rating of restaurant out of 3. I want the rating to come as a legend like in the visuals. I want to count the number of restaurants in each city which are given a rating of 0, 1 and 2. 

So what are you using in the original visuals?

 





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.






SanketBhagwat
Solution Sage
Solution Sage

Hi @Radhika2605 .

You can try implementing the concept of Dynamic Axis using Unpivot Transformation method.

Please refer to the links below in order to implement the same.

https://youtu.be/lFd2hjkKz_Q

OR 

https://www.kasperonbi.com/dynamically-switching-axis-on-visuals-with-power-bi/

 

If this post answers your question, then please mark it as 'Accept as Solution' so that others could find it easily.

 

Regards,

Sanket Bhagwat

Hi Sanket,

 

I tried the second link but was not able to understand much as to how can I use it. 

 

Thanks

Radhika

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.