Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
10 years ago
Solved

Calculating an index from true/false data - SUM.IF formula

Hi    I'm used to apply SUM.IF in Exel but I don't know how do the same via a Measure in Power BI.    I will illustrate my problem by an example. Let's say I have this data:    Sales opportu...
  • Baskar's avatar
    Baskar
    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.

     

     

  • ImkeF's avatar
    ImkeF
    10 years ago

    Yes, Baskar 's solution works fine for that purpose.

     

    But if you're after a more robust solution, this measure would do:

     

    NewAverage = CALCULATE(AVERAGE('Table2'[Revenue]), FILTER(Table2, 'Table2'[Include]=1))

     

    No need to switch to Average in the report-design then.