Forum Discussion
Switch Function Issues
- 8 years ago
From your picture, you have create relationships between Active table and others tables. So you could try the DAX below to create calculated table on Active table.
% of Time =
var AutoFromSalesEE = RELATED(Sales EEs'[Auto %])
var AutoFromAllocation = RELATED(Sales EEs'[Auto %])
Return Switch(
True(),
AutoFromSalesEE< 1, "Partial",
AutoFromSalesEE = 1, "Full",
AutoFromAllocation< 1, "Partial",
AutoFromAllocation = 1, "Full","TBD"
)If this is not what you want, please provide us some sample data and elaborate your expected result. So that we can make further analsyis.
Regards,
Chalrie Liao
From your picture, you have create relationships between Active table and others tables. So you could try the DAX below to create calculated table on Active table.
% of Time =
var AutoFromSalesEE = RELATED(Sales EEs'[Auto %])
var AutoFromAllocation = RELATED(Sales EEs'[Auto %])
Return Switch(
True(),
AutoFromSalesEE< 1, "Partial",
AutoFromSalesEE = 1, "Full",
AutoFromAllocation< 1, "Partial",
AutoFromAllocation = 1, "Full",
"TBD"
)
If this is not what you want, please provide us some sample data and elaborate your expected result. So that we can make further analsyis.
Regards,
Chalrie Liao
v-caliao-msft Actually, I rewrote the formula to this and it worked :-) :
% of Time =
var AutoFromSalesEE = RELATED('Sales EEs'[S Split Time])
var AutoFromAllocation = RELATED('Auto Allocation'[A Split Time])
Return Switch(
True(),
AutoFromSalesEE = "Partial Auto", "Partial Auto",
AutoFromSalesEE = "Full Auto", "Full Auto",
AutoFromAllocation = "Partial Auto", "Partial Auto",
AutoFromAllocation = "Full Auto", "Full Auto",
"TBD"
Thanks so much!!!!!!!!!!!!!!!!!!!!
)