Forum Discussion
Jasonvl
6 years agoFrequent Visitor
DAX comparison error (comparing text with True/False) after adding filter?
Hi,
I have the following formula -
Phonics Yr 1 Expected = CALCULATE([Expected],'A15 Pupil_Assessments'[Assessment] IN { "Phonics Att" })+0
which works fine but I would like to filter it on anojther column in the same table but when I add the filter -
Phonics Yr 1 Expected = CALCULATE([Expected],'A15 Pupil_Assessments'[Assessment],'A15 Pupil_Assessments'[Resultset]="STEP Yr 1 Autumn Target" IN { "Phonics Att" })+0
I then get the Dax comparison error?
Expected is a measure which produces a % which I guess I could add the filter there but that means having more measures?
Resultset is a text column as is Phonics Att.
Any ideas please?
Im not sure I understand correct your logic from a second sentence but if you need AND logic by 2 conditions you can use
Phonics Yr 1 Expected = CALCULATE([Expected], 'A15 Pupil_Assessments'[Assessment] IN { "Phonics Att" }, 'A15 Pupil_Assessments'[Resultset]="STEP Yr 1 Autumn Target" )+0
3 Replies
- az38Community Champion
Im not sure I understand correct your logic from a second sentence but if you need AND logic by 2 conditions you can use
Phonics Yr 1 Expected = CALCULATE([Expected], 'A15 Pupil_Assessments'[Assessment] IN { "Phonics Att" }, 'A15 Pupil_Assessments'[Resultset]="STEP Yr 1 Autumn Target" )+0- JasonvlFrequent Visitor
Thank you so much, I'd tried that but had the comma for the filter in the wrong place and it kept coming up with an error in the formula.
I'm sure DAX is logical to most but I just struggle to get my head round it!
- amitchandakSuper User
Jasonvl , like this
Phonics Yr 1 Expected = CALCULATE([Expected],filter('A15 Pupil_Assessments', 'A15 Pupil_Assessments'[Assessment] IN { "Phonics Att" } && 'A15 Pupil_Assessments'[Resultset]="STEP Yr 1 Autumn Target" ))+0