Forum Discussion

nelalx's avatar
nelalx
Frequent Visitor
3 years ago
Solved

Power BI filter based on a relationship which i cannot make active due to ambiguity error.

I have three tables like above.  In this tables, the below relationships exist. soccermasterdata[RowKey] = country[RowKey]  soccermasterdata[RowKey] = devicedetails[Match]   Also country[Ro...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi nelalx ,

     

    I think this issue should be caused by many to many relationship between country[RowKey] and devicedeatils[Match].

    Here I suggest you to create a DimRowKey table between country and devicedeatils. 

    You can refer to this offical blog:Apply many-to-many relationships in Power BI Desktop to learn more details and the workarounds.

    Or you can create a measure to calcualte the resuly you want by the filter as below.

    Count =
    CALCULATE (
        COUNT ( devicedeatils[DeviceId] ),
        FILTER ( devicedeatils, devicedeatils[Match] = MAX ( country[RowKey] ) )
    )


    Best Regards,
    Rico Zhou

     

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