Forum Discussion
Compare to reference group
- 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
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
OwenAugerThank you so much for your solution. This one is incredible fast compared to my solution. My load time has decreased from 30 seconds to 1 second...amazing 😉
regards
robert