Forum Discussion

ACN_Teo_Garro's avatar
ACN_Teo_Garro
New Member
3 years ago
Solved

Measure with 2 table involved

We have 2 table: 1) CRUSCOTTO: NAME, PRELIEVI_MULTI, RUOLO_MASTER 2) REGOLE_OMOG: RUOLO_MASTER, SOGLIA We must create a new measure that create a sum but with some filter joined between the 2 tabl...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi ACN_Teo_Garro 

    You can try the following Measure.

    test sum prel omog =
    VAR a =
        CALCULATE (
            MAX ( REGOLE_OMOG[SOGLIA] ),
            FILTER (
                REGOLE_OMOG,
                [RUOLO_MASTER] = SELECTEDVALUE ( REGOLE_OMOG[RUOLO_MASTER] )
            )
        )
    RETURN
        CALCULATE (
            SUM ( CRUSCOTTO[PRELIEVI_MULTI] ),
            FILTER (
                CRUSCOTTO,
                [RUOLO_MASTER]
                    IN VALUES ( REGOLE_OMOG[RUOLO_MASTER] )
                        && [ PRELIEVI_MULTI] >= a
            )
        )
    

    And can you provide some sample data?

     

    Best Regards!

    Yolo Zhu

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