Forum Discussion

Leyla's avatar
Leyla
Regular Visitor
7 years ago
Solved

Countif with multiple criteria

HI, please help me to find out the solution for the following situation: I have 2 tables V3 and V4 and I need to get a third table 4 by rows and % which use the temporary table 3 which is the de...
  • v-juanli-msft's avatar
    v-juanli-msft
    7 years ago

    Hi Leyla

    1.

    table3 = var re=RELATED(Table2[value]) return re-[value]

    this formula equal to table3=RELATED(Table2[value])

    it returns the related value from Table2 in Table1 based on the key column(BASE1<->BASE2)

     

    2.

    create a measure instead of a calculated column(in the previous post, i create a calculated column called "per")

    Measure 2 = var co1= CALCULATE(COUNT([value]),FILTER(ALLEXCEPT(Table1,Table1[year]),[value]<-5||[value]>5)) 
    var col2=CALCULATE(COUNT(Table1[table3]),FILTER(ALLEXCEPT(Table1,Table1[year]),[table3]<-5||[table3]>5))
    return col2/co1

    Then change the data format to percentage

     

    3.

    You could change Type(in X-axis) from continous to categorical, but it shows every year on the x-axis. 

    It seems to be that Chart visuals will adjust the data labels automatically (based on label size and chart size) in this scenario. I would suggest you add it as an idea on Power BI Ideas forum to improve Power BI on this feature.

     

    Best Regards

    Maggie