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
StephenK
Resolver I
Resolver I

Count of Students by Number of Tests Failed

Hey all,

 

I'm having a tough time building out a certain visual and need some help. I'm trying to add a bar chart that displays the number of tests failed on the axis and a count of students as the value.

 

I have a fact table set up like so: 

 

StudentIDTestIDTestDateResult
111/1/2021Fail
122/1/2021Fail
231/2/2021Fail
241/15/2021Fail

 

My fact table is related to my Dim Calendar table in the data model.

 

I have been able to build the visual using the following measure and calculated table:

 

 

 

Times Failed = CALCULATE(COUNT('Fact Test Results'[TestID],'Fact Test Results'[Result]="Fail")


Repeat Fails = SUMMARIZE('Fact Test Results','Fact Test Results'[StudentID],"Fails",[Times Failed])

 

 

I then relate this calculated table to my fact table based on the StudentID.

This works to display my bar chart grouping the count of students by the number of times they failed a test.

 

BUT...

 

My problem is that I need this to be affected by my date slicer which is only related to the Fact table. When I set crossfiltering to both on the relationship between my calculated table and fact table, the date slicer seems to affect the calculated table...sorta.

 

The numbers will change, but they are not accurate. For example, if I select a specific day in my date slicer, in theory the axis of the bar chart should only contain a single group--the number of students that failed one time. But it doesn't, there are groups going all the way up to five failures which seem to indicate something is off.

 

Any ideas on how I can get this to work? Thanks!

2 REPLIES 2
v-cazheng-msft
Community Support
Community Support

Hi, @StephenK 

Is your problem solved?

 

Best Regards,

Caiyun Zheng

lbendlin
Super User
Super User

Usually in scenarios like yours the table feeding the date slicer is disconnected from the rest of the data model. Have you considered using that approach?

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.