Forum Discussion
smpa01
Community Champion
5 years agoISEMPTY to evaluate only for connected values
Following is my sample data (pbix attached) and data model I want to bring site and month from keyTbl in a matrix viz and show if there any single row exists in condition tbl...
smpa01
Community Champion
5 years agoI can resolve this with the following measures
keySiteInSiteTbl =
IF (
NOT ISEMPTY (
CALCULATETABLE ( keyTbl, TREATAS ( VALUES ( keyTbl[site] ), site[site] ) )
),
1,
-1
)
XYinConditionTbl =
IF (
NOT ISEMPTY (
CALCULATETABLE (
'condition',
'condition'[condition] IN { "X", "Y" },
ALLEXCEPT ( keyTbl, keyTbl[site] )
)
),
1,
-1
)
Measure4 =
VAR _0 =
IF ( [keySiteInSiteTbl] = 1, [XYinConditionTbl] )
VAR _1 =
IF (
_0 = 1,
"for this site there exists a single row with X or Y in condition tbl",
IF (
_0 = -1,
"for this site there does not exist a single row with X or Y in condition tbl"
)
)
RETURN
_1
But is there an elegant way to solve this by passing a filter in Measure 3?