DAX MIN on Measure 结果为 0 而 table 中没有 0
DAX MIN on Measure results in 0 without 0 in table
每个客户的展位 space 的详细数据来自 table [ExhibitorClass_Details]。措施 [Class_Booth_Space_ALL]
class 通过展位 space 将客户确定为 A、B、C 或 D。
为了能够在视觉效果中使用此度量,我有一个 [Class] table 以及静态值 A、B、C 和 D。
我需要根据 Class.
找到 MAX、MIN、AVG... 展位 space
为了计算每个 classicication 的 MAX 展位 space,我创建了这个度量:
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))
我的测量给出了 MAX 的正确结果。
但是 MIN 的错误结果:
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))
不是给我每个 class 的 MIN(如红色所示),而是结果为 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))
我也试过第二个版本,但它给出了相同的 0 结果。
谁能帮帮我。
这里是例子 [ExhibitorClass_Details] 数据:
|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|
这里是截断点:
|A|2000|
|B|1000|
|C|500|
|D|0|
和class化的截止度量:
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")
不确定我是否完全理解您当前对 Visual Count Class MAX Booth Space ALL 和 Visual Count [=21] 的构造=] MIN 展位 Space ALL。除非我遗漏了什么,否则他们似乎不必要地同时使用 MIN
和 MINX
.
我会使用类似的东西:
Visual Count Class MIN Booth Space ALL =
VAR _rank_class =
SELECTEDVALUE( 'Class'[Class] )
RETURN
CALCULATE(
MIN( ExhibitorClass_Details[Booth_Space_ALLPREV] ),
FILTER(
ExhibitorClass_Details,
[Class_Booth_Space_ALL] = _rank_class
)
)
尝试:
Visual Count Class MIN Booth Space ALL =
VAR _rank_class = SELECTEDVALUE('Class'[Class])
return
CALCULATE(
MIN( ExhibitorClass_Details[Booth_Space_ALLPREV] ),
ALL( ExhibitorClass_Details ),
ExhibitorClass_Details[Booth_Space_ALLPREV] = _rank_class,
ExhibitorClass_Details[Booth_Space_ALLPREV] > 0
)
每个客户的展位 space 的详细数据来自 table [ExhibitorClass_Details]。措施 [Class_Booth_Space_ALL]
class 通过展位 space 将客户确定为 A、B、C 或 D。
为了能够在视觉效果中使用此度量,我有一个 [Class] table 以及静态值 A、B、C 和 D。
我需要根据 Class.
找到 MAX、MIN、AVG... 展位 space
为了计算每个 classicication 的 MAX 展位 space,我创建了这个度量:
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))
我的测量给出了 MAX 的正确结果。
但是 MIN 的错误结果:
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))
不是给我每个 class 的 MIN(如红色所示),而是结果为 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))
我也试过第二个版本,但它给出了相同的 0 结果。 谁能帮帮我。
这里是例子 [ExhibitorClass_Details] 数据:
|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|
这里是截断点:
|A|2000|
|B|1000|
|C|500|
|D|0|
和class化的截止度量:
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")
不确定我是否完全理解您当前对 Visual Count Class MAX Booth Space ALL 和 Visual Count [=21] 的构造=] MIN 展位 Space ALL。除非我遗漏了什么,否则他们似乎不必要地同时使用 MIN
和 MINX
.
我会使用类似的东西:
Visual Count Class MIN Booth Space ALL =
VAR _rank_class =
SELECTEDVALUE( 'Class'[Class] )
RETURN
CALCULATE(
MIN( ExhibitorClass_Details[Booth_Space_ALLPREV] ),
FILTER(
ExhibitorClass_Details,
[Class_Booth_Space_ALL] = _rank_class
)
)
尝试:
Visual Count Class MIN Booth Space ALL =
VAR _rank_class = SELECTEDVALUE('Class'[Class])
return
CALCULATE(
MIN( ExhibitorClass_Details[Booth_Space_ALLPREV] ),
ALL( ExhibitorClass_Details ),
ExhibitorClass_Details[Booth_Space_ALLPREV] = _rank_class,
ExhibitorClass_Details[Booth_Space_ALLPREV] > 0
)