Forum Discussion
if else statement in dax function
Anonymous , Can you please share sample data and sample output in table format?
I provided a solution on this topic last time, seems like that did not work for you. So need sample
Yes amitchandak ,
As per your solution whenever I select US and Canada or APAC its not showing the respected departments that we writeen in the logic.
As per your dax function I am getting only regions instead of the department names
Sample Data :
| Department | Sales |
| Central | 100 |
| Georgia | 200 |
| Hyd | 300 |
| Pune | 400 |
Table I created in Power BI:
| Region Names |
| US and Canada |
| APAC |
Thats why I posted again
- Anonymous4 years agoNot applicable
- amitchandak3 years agoSuper User
Anonymous , refer the new column code above
- amitchandak3 years agoSuper User
Anonymous , You do not need a table you need a column. If you have that table join with this column
Switch( True() ,
[Department] in {"Central","Georgia"} , "US and Canada",
[Department] in {"Hyd","Pune"} , "APAC",
"Other"
)
If this does work, Please share the final outcome on tableau
- Anonymous3 years agoNot applicable
Hi amitchandak ,
Below is what I am expecting .
In the DAX you mentioned above you are not using the table I created inside power BI for regions.