Forum Discussion

OPS-MLTSD's avatar
OPS-MLTSD
Icon for Post Patron rankPost Patron
4 years ago
Solved

Create relationship between two tables that do not have unique values

Hello,   I have 3 tables - clients, targets, and location.   I am trying to count how many clients started and finished services within a certain target fiscal year and in a certain target catego...
  • sevenhills's avatar
    sevenhills
    4 years ago

    one more attempt... see which of these measures work for your scenario.

     

     

    Measure 3 = 
    var _l = SELECTEDVALUE(Targets[Location ID])
    var _FY = SELECTEDVALUE(Targets[Target Fiscal Year])
    RETURN CALCULATE(
            count( Client_Locations[client id]) 
            , Filter(Targets, Targets[Target Category] = "Client Starts" )
            , Client_Locations[location ID] = _l
            , Client_Locations[start fiscal year] = _FY
    )
    Measure = 
    CALCULATE(
            count( Client_Locations[client id]) 
            , Filter(Targets, Targets[Target Category] = "Client Starts")
            , TREATAS (
                SUMMARIZE(Targets, Targets[Location ID], Targets[Target Fiscal Year])
                ,  Client_Locations[location ID], Client_Locations[start fiscal year]
                )
    )
    

     

     

    You are doing is common scenario when you have multiple fact tables and getting related counts based on business needs.