Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Solved! Go to Solution.
The error is in this line:
app_tblVendors[Vendor]="NTTD",
You are comparing a column to a string without specifying a specific row in that column.
Try this instead since you wanted to check if it includes "NTTD":
"NTTD" IN VALUES ( app_tblVendors[Vendor] )
As a side note, I much prefer using SWITCH to nested IF statements and using variables helps too.
Try this refactoring:
IsTopVendor =
VAR _Rank = [Vendor Rank]
VAR _RankNTTD = CALCULATE ( [Vendor Rank], app_tblVendors[Vendor] = "NTTD" )
VAR _IncludesNTTD = "NTTD" IN VALUES ( app_tblVendors[Vendor] )
RETURN
SWITCH (
TRUE (),
_RankNTTD <= 10 && _Rank <= 10, 1,
_RankNTTD > 10 && ( _Rank < 10 || _IncludesNTTD ), 1,
0
)
The error is in this line:
app_tblVendors[Vendor]="NTTD",
You are comparing a column to a string without specifying a specific row in that column.
Try this instead since you wanted to check if it includes "NTTD":
"NTTD" IN VALUES ( app_tblVendors[Vendor] )
As a side note, I much prefer using SWITCH to nested IF statements and using variables helps too.
Try this refactoring:
IsTopVendor =
VAR _Rank = [Vendor Rank]
VAR _RankNTTD = CALCULATE ( [Vendor Rank], app_tblVendors[Vendor] = "NTTD" )
VAR _IncludesNTTD = "NTTD" IN VALUES ( app_tblVendors[Vendor] )
RETURN
SWITCH (
TRUE (),
_RankNTTD <= 10 && _Rank <= 10, 1,
_RankNTTD > 10 && ( _Rank < 10 || _IncludesNTTD ), 1,
0
)
User | Count |
---|---|
103 | |
90 | |
78 | |
72 | |
68 |
User | Count |
---|---|
110 | |
96 | |
95 | |
74 | |
71 |