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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Krista
Frequent Visitor

Show values from parent category when child selected

I have student-level data from course evaluations for courses, and I want to be able to compare those ratings (on multiple factors) for a single course to the average ratings from various categories of courses, namely to:

1. the average ratings of the concentration to which the course belongs

2. the average ratings of the program to which the concentration belongs.

 

Courses can be homed within more than one of the parent categories, something like this:

Krista_0-1694621612623.png

What I want:

When a user selects a program and a course from slicers, a bar graph shows the ratings from that course, and the averages for the relevant comparison categories are automatically displayed (either on the same graph or on separate ones), without the user having to select the concentration (because they often don't know to which concentration(s) a course belongs).

 

What is the best way to accomplish this?

 

Currently, I have:

  • a fact table that has one row for each course/concentation/program combination, so that each course can potentially have more than one row, if it belongs to more than one category
  • an unpivoted data table with a column for value (ratings) and one for attribute (the survey questions), with a row being a student/course/semester/survey question

Krista_1-1694623069750.png

 

 

I also have slicers for course, concentration, and program, and this works *okay* but runs into the classic problem of returning blank visuals when the user changes a course without changing its relevant category (because the previous item remains selected). 

 

Is there a better way to model my data to accomplish my goal? Or a DAX trick to make one visual show the other members in a parent category when the child is selected?

3 REPLIES 3
v-shex-msft
Community Support
Community Support

Hi @Krista,

According to your description, I'd like to suggest you create an unconnected table as source of slicer.
Then you can write a measure formula to extract the parent level field value and use it as condition to compare with current row context and return flag.
After these steps, you can use it on 'visual level filter' to filter records based on the filter with child level values.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Thanks for your reply, Xiaoxin! 

 

Do you have an example of what the Dax for that measure would look like? I think that is exactly the point where I'm getting stuck - how to extract the parent value.

 

Thanks, 

Krista 

Hi @Krista ,

Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.