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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
hrafnkel11
Helper I
Helper I

Calculated Column Ignoring Slicer Selection

Happy Friday!

 

I am having issues with a calculated column where I have a people table and need to bring in the total passed tests for each person from another table. I’m trying to do this as a calculated column, because there are multiple types of tests and I need to run a conditional column across them to determine final results for each person.

 

The complication I am having is that the person table is a snapshot that has one person record per “as of date”. Because of this, I have one date table governing the people and a separate date table governing the tests (since when someone took a test is irrespective of which “as of date” someone chooses). I need a user to be able to choose the as of date for the people population, as well as the date range for when tests were completed.

 

This is the calculated column I’m having trouble adding to the PERSON table. I’ve tried multiple versions of this and either get ALL tests regardless of which test date is selected or in the case of the below, I get partial data (very limited number of records, all correct, but everything else blank).

 

I feel like I’m missing something elementary here, so any help would be massively appreciated. Thanks!

 

 

 

_Test_Type_1_Passes = 
var _startdate = min('TEST DATE'[DATE])
var _enddate = max('TEST DATE'[DATE])
return
CALCULATE(
    COUNTROWS(
        FILTER('Test Data',
        'Test Data'[Result]="Pass" &&
        'Test Data'[Type]= "1" &&
        selectedvalue('Test Data'[Date]) >= _startdate && 
        selectedvalue('Test Data'[Date]) <= _enddate
    )))

 

 

 

I have a feeling it's due to how my model is set up, but I hesitate changing it if possible, since this is part of a much wider report. Here's a simplified model:

 

hrafnkel11_0-1679066764780.png

 

Expected result in person table:

PersonTest_Type_1_PassesTest_Type_2_PassesTest_Type_3_Passes
John301
Sally521
Anders100
1 ACCEPTED SOLUTION
hrafnkel11
Helper I
Helper I

Update: I've gotten this to work by abandoning the calculated column and just using a measure. I feel like this is usually the answer every time I have a problem with a calculated column.

View solution in original post

1 REPLY 1
hrafnkel11
Helper I
Helper I

Update: I've gotten this to work by abandoning the calculated column and just using a measure. I feel like this is usually the answer every time I have a problem with a calculated column.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors