please could you help me with the below measure.
My table: query 1 The column “Indicator” contains unique number like, 119. MertricNumerator is my calculated filed by choosing option from slicer I want to get the result for Indicator number 119, then IF sum( numerator) is blank OR 0 or null “No Data” if Sum(numerator) < 5 show “low count of data” else SUM(Query1[Metric_Numerator]) Many Thanks
{ MEASURE= IF( SELECTEDVALUE(Query1[indicator])=119 && SUM(Query1[Metric_Numerator])<5, "Low count number", IF( SELECTEDVALUE(Query1[indicator])=119 && SUM(Query1[Metric_Numerator])=0 ||ISBLANK(SUM(Query1[Metric_Numerator])), "No Data", SUM(Query1[Metric_Numerator]) )) }
There are 2 things that doesn't allow you to get expected result.
1 - your second IF
expression is a && b || c
a && b || c
. DAX engine doesn't understand how do you want to evaluate this expression - like (a && b) || c
(a && b) || c
or like a && (b || c)
. DAX will evaluate the expression as (a && b) || c
(a && b) || c
, because && has higher priority level. Also, the expression is evaluated in the order that operators appears in the expression, from left to right. So, supply the expression with brackets.
2 - you want to get different data types from one expression - a string or number. It's needed to be corrected.
Please, check the corrected measure.
MEASURE =
IF(
SELECTEDVALUE(Query1[indicator])=119 && SUM(Query1[Metric_Numerator])<5
,"Low count number"
,IF(
SELECTEDVALUE(Query1[indicator])=119
&&
(
SUM(Query1[Metric_Numerator])=0
||
ISBLANK(SUM(Query1[Metric_Numerator]))
)
,"No Data"
,"" & SUM(Query1[Metric_Numerator])
)
)
This can work, but I would use SWITCH()
instead.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.