March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe 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
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:
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
Could someone please help?
Thanks
Radhika
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.
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.
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])
?
Proud to be a Super User!
Paul on Linkedin.
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?
Proud to be a Super User!
Paul on Linkedin.
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.
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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
User | Count |
---|---|
90 | |
89 | |
85 | |
73 | |
49 |
User | Count |
---|---|
167 | |
148 | |
92 | |
72 | |
58 |