Forum Discussion
IF condition based on two different tables
- 8 years ago
Hi Anonymous,
For using Related(), you need to have a direct active relationship between the tables. In your case, Budget and Enhacements.
If possible, create a link between them. In case if not possible, try to create an inactive relationship between them and use the USERELATIONSHIP() DAX in your calculated column to get the desired column from Enhacements table. But I am not sure, if it will allow you to use something like RELATED() with it. Need to check on this functionality. Instead you can use SUMMARIZE() Function for the same
Model:
1. Create the column as below. I was able to achieve the first column using a different approach as shown below
Enhancements.Value = CALCULATETABLE(SUMMARIZE(Enhancements,Enhancements[VALUE]), USERELATIONSHIP(Budgets[ID],Enhancements[ID]))
This shows my Budget table before and after including that new column. Also shows the other tables that I have considered
The Other steps would remain the same
2. Column2 = If('Budget'[Value] = 0 || 'Budget'[Value] = "" || 'Enhancement'[Value] = 0 || 'Enhancement'[Value] = "",X, [Value]
3. Then in your report you can filter out X for column 2
P.S. Get Detailed info of those functions and their usage from the links provided
Regards,
Thejeswar
Hi Jorgast
Thanks a lot for your help. But I can't seem to be able to even create the first column. When I try to, it says there's no such table or it has no established relationship with the other table, eventhough they are connected through a fact table:
Any ideas on what could be triggeting this, or maybe if there's a different way of achieving the same result?
Are you creating a column or a calculated measure.
If your data is not sensitive, please post ur pbix here.