Forum Discussion
Krcmajster
6 years agoHelper IV
Select values based on conditions
So I have 3 tables, one with locations and 2 with sales and dates. My dev didn't created dates tabel, so my question is: Can you use dax to select columns based on condition, and that would be ve...
- Anonymous6 years ago
Hi Krcmajster ,
If i understand you correctly, you can use UNION() function to create a calculated table which contains table1 and table2 then use vendor as silcer if you want.
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
jstorm
6 years agoResolver III
If the tables are related you could use an IF() based on your vendor. For example:
IF( [vendor] = "Ven1",
CALCULATE( SUM( 'Sales1'[Sales] ), 'Sales1'[Dates] ),
CALCULATE( SUM( 'Sales2'[Sales] ), 'Sales2'[Dates] )
)
(If the vendor is "Ven1" uses first calculate function with Sales1 table, else, use second calculate with Sales2 table.)