0
votes

The detailed data with booth space per customer comes from the table [ExhibitorClass_Details]. The measure [Class_Booth_Space_ALL] classifies the customer by booth space to A,B,C or D.
To be able to use this measure in visuals I have a [Class] table as well with the static values A,B,C and D.

I need to find the MAX, MIN, AVG... booth space per Class.

To calculate the MAX booth space per classicication I have created this measure:

Visual Count Class MAX Booth Space ALL = 
  VAR _rank_class = SELECTEDVALUE('Class'[Class]) 
  return MAXX('ExhibitorClass_Details', if([Class_Booth_Space_ALL] = _rank_class,
               calculate(MAX(ExhibitorClass_Details[Booth_Space_ALLPREV])),0))

My measure gives the right results for MAX.

But the wrong result for MIN: enter image description here

Visual Count Class MIN Booth Space ALL = 
  VAR _rank_class = SELECTEDVALUE('Class'[Class]) 
  return MINX('ExhibitorClass_Details', if([Class_Booth_Space_ALL] = _rank_class,
               calculate(MAX(ExhibitorClass_Details[Booth_Space_ALLPREV])),0))

Instead of giving me the MIN for every class (as shown in red) it just results in 0.

Visual Count Class MIN Booth Space ALL = 
  VAR _rank_class = SELECTEDVALUE('Class'[Class]) 
  return MINX('ExhibitorClass_Details', if([Class_Booth_Space_ALL] = _rank_class,
               calculate(MIN(ExhibitorClass_Details[Booth_Space_ALLPREV])),0))

I have also tried a second version but it gives the same 0 results. Can anyone please help me.

Here is the example [ExhibitorClass_Details] data:

|Costomer_Name|Booth_Space_ALLPREV|
|Megatech|30|
|CyberMunch|210|
|Digiwell|410|
|Innovix|110|
|Cloudmore|1410|
|Systemiq|610|
|Smartsoft|150|
|Clickwell|2410|
|Weblund|170|
|Quanterra|90|
|Avantex|270|
|Ventura|150|
|Sphere|450|
|Bitling|70|
|Elementaliq|130|

and the measure for the classification:

Class_Booth_Space_ALL = 
SWITCH(TRUE(),
    SUMX(ExhibitorClass_Details, ExhibitorClass_Details[Booth_Space_ALLPREV]) >= [Booth Space ALL A CutOff],"A",
    SUMX(ExhibitorClass_Details, ExhibitorClass_Details[Booth_Space_ALLPREV]) >= [Booth Space ALL B CutOff]
    && SUMX(ExhibitorClass_Details, ExhibitorClass_Details[Booth_Space_ALLPREV]) < [Booth Space ALL A CutOff],"B",
    SUMX(ExhibitorClass_Details, ExhibitorClass_Details[Booth_Space_ALLPREV]) >= [Booth Space ALL C CutOff]
    && SUMX(ExhibitorClass_Details, ExhibitorClass_Details[Booth_Space_ALLPREV]) < [Booth Space ALL B CutOff],"C",
    SUMX(ExhibitorClass_Details, ExhibitorClass_Details[Booth_Space_ALLPREV]) >= [Booth Space ALL D CutOff]
    && SUMX(ExhibitorClass_Details, ExhibitorClass_Details[Booth_Space_ALLPREV]) < [Booth Space ALL C CutOff],"D",
    "N/A")
Copiable data tables, even if reduced and not your real data, are far better than pictures.Jos Woolley
Example data and Classification measure are awailable now.Johnny Spindler
Thanks. Are the CutOff measures all similar in nature? Can you share one of them?Jos Woolley