Forum Discussion
MichaelC18
2 years agoRegular Visitor
Multiple tables adding numeric number once per table
Hello, I have a question I just cant figure out. I have my powerbi with a field I named EWS Score in each table. I have my calculated field working across all tables and my measure. However, having 4...
MargusMartsepp
2 years agoNew Member
Use FILTER with ALL to ensure that you're working with a valid table expression.
TotalUniqueCounts =
VAR CountTableA = CALCULATE(COUNTROWS('Attendance'), FILTER(ALL('Attendance'[OTHER-ID]), 'Attendance'[EWS Score] = 1))
VAR CountTableB = CALCULATE(COUNTROWS('Discipline Datamining'), FILTER(ALL('Discipline Datamining'[Other ID]), 'Discipline Datamining'[EWS Score] = 1))
VAR CountTableC = CALCULATE(COUNTROWS('EWS POSTED GRADES'), FILTER(ALL('EWS POSTED GRADES'[Stdt ID]), 'EWS POSTED GRADES'[EWS Score] = 1))
VAR CountTableD = CALCULATE(COUNTROWS(TEST_SCORES_ELAMATLEVELS), FILTER(ALL(TEST_SCORES_ELAMATLEVELS[Other ID]), TEST_SCORES_ELAMATLEVELS[EWS Score] = 1))
RETURN
CountTableA + CountTableB + CountTableC + CountTableD
MichaelC18
2 years agoRegular Visitor
I still get an error. Not sure why this one seems to be fighting me.