Forum Discussion
Calculating an index from true/false data - SUM.IF formula
- 10 years ago
1. create the conditional filed which i mention in first reply on this post like this.
2. Create one calculation or Directly drag the Value measure into the card and choose as Average
3. Darg the final Condtional Column into visual filter and choose greater than "0" Thats it Dude.
Anonymous in that case create three measures as below,
AvgIfCarHasBackSeats = CALCULATE( (SUM(sam[Revenue]) / COUNt(sam[Revenue])) * 100 , sam[Does the car have backseats?] = "TRUE" )
AvgIfCarBlue = CALCULATE( (SUM(sam[Revenue]) / COUNt(sam[Revenue])) * 100 , sam[Is Car Blue?] = "TRUE" )
AvgIfCarIs4WD = Measure = CALCULATE( (SUM(sam[Revenue]) / COUNt(sam[Revenue])) * 100 , sam[Is the Car 4WD?] = "TRUE" )
ankitpatira Thanks for your answer.
From your solution I will up evaluate each one of the values individual.
I want to evalualte the row including either one or more of each criteria to be TRUE.
BR
Anders
- ankitpatira10 years ago
Community Champion
Anonymous Below should work. also ensure column of true / false in power bi desktop are defined as data category Text.
Measure = CALCULATE( (SUM(sam[Revenue]) / COUNt(sam[Revenue])) * 100 ,
OR (
sam[Does the car have backseats?] = "TRUE",
sam[car 4wd?] = "TRUE",
sam[car blue?] = "TRUE"
))
- Anonymous10 years agoNot applicable
ankitpatira
I don't think the OR ( ) function for this works. Am I right?It dosen't work for me... It says something about "the highest number of arguements for this function is 2" - do I put the seperators wrong?
- ankitpatira10 years ago
Community Champion
Anonymous ok then try with using SWITCH() function. SWITCH will work,