Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Need help with Dax

Hi,

I need help on Dax for calculating the number of positions that are carryforwarded to the next year. I am getting the wrong value.

The Dax which i am using is 

carry = CALCULATE(
COUNTX(
FILTER(
TA,[Open Date (DD-MMM-YYYY)]<=MAX(Dim_Date[Date]) &&
ISBLANK([Joining Date MM/DD/YYYY]) ||
[Joining Date MM/DD/YYYY] > MAX(Dim_Date[Date])), TA[Req ID]),
FILTER(Dim_Date, Dim_Date[Year]=(Dim_Date[Year]-1))).

I have date table and a table with the Name TA where i have open date and Joining date . I am trying to calculate the number of positions that had carried over to the next year.

Please help.

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  Anonymous ,

    You can try modifying dax to the following:

    carry  =
    CALCULATE(
    COUNTX(
        FILTER(ALL(TA),
        AND(
        [Open Date (DD-MMM-YYYY)]<=MAX('Dim_Date'[Date]),ISBLANK('TA'[Joining Date MM/DD/YYYY]))
        ||
        'TA'[Joining Date MM/DD/YYYY]>MAX('Dim_Date'[Date])),'TA'[Req ID]),
        FILTER(ALL('Dim_Date'),'Dim_Date'[Year]='Dim_Date'[Year]-1))

     

    Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.