Forum Discussion

tmhrzgr's avatar
tmhrzgr
Frequent Visitor
6 years ago
Solved

Measure with data from other table with multiple conditions

Hi all, I'm a little bit confused by a Measure as I'm looking for the right solution, but can't find it. 😞 Hope you can help me. (And sorry for the wall of text. :)) First of all some sample-data:...
  • v-lid-msft's avatar
    6 years ago

    Hi tmhrzgr ,

     

    We can try to use the following measure to solve it:

     

    ZielProzentBZuLi =
    VAR z70p =
        CALCULATE (
            MAX ( ZieleNV[70p] );
            FILTER (
                ZieleNV;
                ZieleNV[Team] IN DISTINCT ( Tickets[Team] )
                    && ZieleNV[SlaTyp] IN DISTINCT ( Tickets[SlaTyp] )
            )
        )
    VAR z100p =
        CALCULATE (
            MAX ( ZieleNV[100p] );
            FILTER (
                ZieleNV;
                ZieleNV[Team] IN DISTINCT ( Tickets[Team] )
                    && ZieleNV[SlaTyp] IN DISTINCT ( Tickets[SlaTyp] )
            )
        )
    VAR z150p =
        CALCULATE (
            MAX ( ZieleNV[150p] );
            FILTER (
                ZieleNV;
                ZieleNV[Team] IN DISTINCT ( Tickets[Team] )
                    && ZieleNV[SlaTyp] IN DISTINCT ( Tickets[SlaTyp] )
            )
        )
    RETURN
        SWITCH (
            TRUE ();
            BZuLi[SlaProzentBZuLi] >= z150p; 1,5000;
            BZuLi[SlaProzentBZuLi] >= z100p
                && BZuLi[SlaProzentBZuLi] < z150p; 1,0 + 0,5 * ( BZuLi[SlaProzentBZuLi] - z100p ) / ( z150p - z100p );
            BZuLi[SlaProzentBZuLi] >= z70p
                && BZuLi[SlaProzentBZuLi] < z100p; 0,7 + 0,3 * ( BZuLi[SlaProzentBZuLi] - z70p ) / ( z100p - z70p );
            BZuLi[SlaProzentBZuLi] < z70p; 0,7 * BZuLi[SlaProzentBZuLi]
        )
    

     

    If it does not work, could you please check the result of variable z70p/z100p/z150p in origin measure and new measure? What field is filtered in the report?


    Best regards,