Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Need help on DAX

Hi,I have data as below in the second picture. I need to create a calculated column based on the values of enter_by.1,enter_by.2 and so on. The data also has a region_id column. Have a mapping table as in picture1.

Would like to create something like below based on the information I have -

 

if [region_id]=1 then
(if [enter_by.1]="ODB" then "ODB" else if [enter_by.2]="ODB" then "ODB" else if [enter_by.3]="ODB" then "ODB" else if [enter_by.4]="ODB" then "ODB" else if [enter_by.5]="ODB" then "ODB" else if [enter_by.6]="ODB" then "ODB" else if [enter_by.7]="ODB" then "ODB" else if [enter_by.8]="ODB" then "ODB" else if [enter_by.9]="ODB" then "ODB" else if [enter_by.10]="ODB" then "ODB" else if [enter_by.11]="ODB" then "ODB" else if [enter_by.12]="ODB" then "ODB" else if [enter_by.13]="ODB" then "ODB" else if [enter_by.14]="ODB" then "ODB" else if [enter_by.16]="ODB" then "ODB" else if [enter_by.17]="ODB" then "ODB" else if [enter_by.18]="ODB" then "ODB" else if [enter_by.19]="ODB" then "ODB" else if [enter_by.20]="ODB" then "ODB" else if [enter_by.21]="ODB" then "ODB" else if [enter_by.22]="ODB" then "ODB" else if [enter_by.23]="ODB" then "ODB" else if [enter_by.24]="ODB" then "ODB" else if [enter_by.25]="ODB" then "ODB" else if [enter_by.26]="ODB" then "ODB" else if [enter_by.27]="ODB" then "ODB" else if [enter_by.28]="ODB" then "ODB" else null)
else
if [region_id]=2 then
(if [enter_by.1]="BDB" then "BDB" else if [enter_by.2]="BDB" then "BDB" else null)
else null

 

 

Any ideas will be really helpfule. Please let me know for more clarifications.

region.PNG

data.PNG

3 REPLIES 3
parry2k
Super User
Super User

@Anonymous what you want to achieve the end result? Just calculated column? How you want to use it? THe formula you showed what is the problem wiht that?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Thanks for replying.

 

Can I achieve something like this using DAX?

 

I had written the formula in Power Query and was working there.

What about using nested ifelse in DAX for a calculated column?

WHat is the best practice?

@Anonymous yes you can surely achieve the same with DAX 

My Column in Dax = 
if( Table[Column] = Value, <then condition>,
if( Table[Column] = Valie, <then condition>,
<else condition>
)
)


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors