Forum Discussion

addicted87's avatar
addicted87
Helper I
6 years ago
Solved

Compare to reference group

hey power bi users, i've got following issue with my power bi report:   What I'm going to do? I want to compare one single supplier to a reference group consisting of 1...n different suppliers wi...
  • OwenAuger's avatar
    6 years ago

    Hey addicted87 

     

    Here is a measure you could try. Using some test data at my end, it performed significantly better than the original measure:

    number of suppliers in reference group =
    VAR FilteredSupplierKey =
        VALUES ( supplier[column_supplier_id] )
    VAR SimilarSupplierKey =
        CALCULATETABLE (
            VALUES ( supplier[column_supplier_id] );
            ALL ( supplier[column_supplier_id] );
            SUMMARIZE (
                supplier;
                supplier[column_customers];
                supplier[column_region];
                supplier[column_employees]
            )
        )
    RETURN
        COUNTROWS ( EXCEPT ( SimilarSupplierKey; FilteredSupplierKey ) )

    This should follow the same logic as your original measure when filtered on a single Supplier ID.

    This measure also handles cases where you have filtered on multiple Supplier IDs, by counting the union of "similar" Suppliers.

     

    Does this perform better with your data, and still produce correct results?

     

    Regards

    Owen