Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

DAX Formula Help

I'm hoping you may be able to help. I'm creating a report for interns over years. There is a column telling which program an intern is in, SIE (Summer Intern experience) or SH (Summer Hire). The user...
  • technolog's avatar
    2 years ago

    Hello,

    To replicate the functionality of your Excel formula in Power BI using DAX, you'll need to create a measure that evaluates whether an intern has converted from a Summer Hire (SH) to a Summer Intern Experience (SIE) program. The Excel formula you are using checks if an intern has records in both SH and SIE categories and returns 1 if true, otherwise 0.

    In Power BI, you can achieve this with a combination of CALCULATE and FILTER functions within a measure. Here is an example of how you might structure your DAX formula:


    InternConversion =
    VAR InternSH = CALCULATE(COUNTROWS('Table'), FILTER('Table', 'Table'[SIE/SH] = "SH"))
    VAR InternSIE = CALCULATE(COUNTROWS('Table'), FILTER('Table', 'Table'[SIE/SH] = "SIE"))
    RETURN IF(InternSH > 0 && InternSIE > 0, 1, 0)