Forum Discussion

ABHIS702's avatar
ABHIS702
Frequent Visitor
8 years ago
Solved

Array Formulae in Power BI

Hi,

 

I'm new to Power BI and need help to add a custom column in my query.

I have a database of employees across companies with 3 columns which looks like below (only first three columns)

 

I'm trying to add a custom column i.e. Median Age Per Organisation. In excel, I can achieve it using an array formuale-

{=MEDIAN(IF(B2=$B$2:$B$8,$C$2:$C$8,""))}

 

Please help. Further, if I with to further slice it by say "gender", how can  I do that?

 

Regards

Abhishek Jain

  • Zubair_Muhammad's avatar
    Zubair_Muhammad
    8 years ago

    ABHIS702

     

    Or this one

     

    =
    CALCULATE (
        VALUE ( MEDIAN ( Table1[Age] ) ),
        ALLEXCEPT ( Table1, Table1[Company] )
    )
  • ABHIS702

     

    Sorry I was away for a while

     

    Try this

     

    =
    CALCULATE (
        VALUE ( MEDIAN ( Table1[Age] ) ),
        ALLEXCEPT ( Table1, Table1[Company], Table1[Gender] )
    )

9 Replies