Forum Discussion

RavitPBI's avatar
RavitPBI
Frequent Visitor
5 years ago
Solved

Calculation using different tables with no relationship

Table A: Outbound Date_id Org_id OutboundUnits 1 80 500.00 2 80 600.00 3 80 700.00 1 86 100.00 2 86 200.00 3 86 300.00   Table B: Inbound Date_id Org_id ...
  • v-janeyg-msft's avatar
    5 years ago

    Hi, RavitPBI 

     

    It’s my pleasure to answer for you.

    According to your description, I think you can create two slicers(column in table C) and a measure to calculate the desired result.

    Like this:

    HoursNeeded =
    VAR dateid =
        SELECTEDVALUE ( GoalUPH[Date_id] )
    VAR orgid =
        SELECTEDVALUE ( GoalUPH[Org_id] )
    VAR sumunits =
        SUMX (
            FILTER ( ALL ( Outbound ), [Date_id] = dateid && [Org_id] = orgid ),
            [OutboundUnits]
        )
            + SUMX (
                FILTER ( ALL ( Inbound ), [Date_id] = dateid && [Org_id] = orgid ),
                [InboundUnits]
            )
    RETURN
        IF (
            ISFILTERED ( GoalUPH[Date_id] ) && ISFILTERED ( GoalUPH[Org_id] ),
            DIVIDE ( sumunits, SELECTEDVALUE ( GoalUPH[GoalUPH] ) ),
            0
        )

    If it doesn’t solve your problem, please feel free to ask me.

     

    Best Regards

    Janey Guo

     

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