Forum Discussion
Anonymous
3 years agoNot applicable
Conditions in measure
Hi Community. I need to classify customers by conditions. I have a DB with a Direct Query connection and conditions in two tables that are loaded locally (from SharePoint). I can't use import mod...
- 3 years ago
Hi Anonymous ,
Try the following code:
Classification type 1 = VAR measurecalc = [Value by Customer] VAR ClassificationType1 = CALCULATETABLE ( 'LD - First Conditions', 'LD - First Conditions'[Customer] IN VALUES ( 'DQ - Sample Table'[Customers] ), 'LD - First Conditions'[Channel] IN VALUES ( 'DQ - Sample Table'[Channel] ), 'LD - First Conditions'[Target Value] <= measurecalc ) var FinalResult1 = MAXX ( ClassificationType1, 'LD - First Conditions'[Type] ) VAR ClassificationType2 = CALCULATETABLE ( 'LD - Second Conditions', 'LD - Second Conditions'[Customer] IN VALUES ( 'DQ - Sample Table'[Customers] ), 'LD - Second Conditions'[Period] IN VALUES ( 'LD - Second Conditions'[Period] ), 'LD - Second Conditions'[Target Value] <= measurecalc ) var FinalResult2 = MAXX ( ClassificationType2, 'LD - Second Conditions'[Type] ) RETURN COALESCE(FinalResult1, FinalResult2)
MFelix
Super User
3 years agoAre the tables with the information about the classification of the customers very large?
Anonymous
3 years agoNot applicable
In 3 tables 2K, 5.6 mio and 7.4 mio rows.