Forum Discussion
Jeenz
4 years agoFrequent Visitor
Filter having conditions from multi[ple tables
Problem: Non - Microsoft Resellers who do not have Transactions with MS from 2020-07 to 2022-06 conditions: Vendor partner NOT EQUAL TO "Microsoft" (Vendor table) Reseller[Is Test Reselle...
- 4 years ago
Hi Jeenz
The UNION function in DAX doesn't remove duplicates like it does with SQL. Is that the problem? If so, change this line as followsVAR UnionResult = DISTINCT( UNION(C1,C2,C3,C4) )For what it's worth, I wonder if you coule simplify your measure immensely with the following
CALCULATETABLE( VALUES(Reseller[Company Name]), Vendor[Parent Vendor] <> "Microsoft", -- continue this as necessary Reseller[Is Test Reseller] = FALSE(), -- you should have set this as a boolean field, not text Subscription[Is Trial] = FALSE(), -- also boolean ('Calendar'[Date] >= DATE(2020, 6, 1) && 'Calendar'[Date] <= DATE(2020, 7, 1)) )Hope this helps!
littlemojopuppy
Community Champion
4 years agoHi Jeenz
The UNION function in DAX doesn't remove duplicates like it does with SQL. Is that the problem? If so, change this line as follows
VAR UnionResult =
DISTINCT(
UNION(C1,C2,C3,C4)
)
For what it's worth, I wonder if you coule simplify your measure immensely with the following
CALCULATETABLE(
VALUES(Reseller[Company Name]),
Vendor[Parent Vendor] <> "Microsoft", -- continue this as necessary
Reseller[Is Test Reseller] = FALSE(), -- you should have set this as a boolean field, not text
Subscription[Is Trial] = FALSE(), -- also boolean
('Calendar'[Date] >= DATE(2020, 6, 1) &&
'Calendar'[Date] <= DATE(2020, 7, 1))
)
Hope this helps!
Jeenz
4 years agoFrequent Visitor
Thank You So much littlemojopuppy . It Helped a lot!!