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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
murugesh_c
Frequent Visitor

Need help in creating Dax from the Excel formula

IF(AND(A1<0,B2<>""),"SMU",IF(AND(A1>0,B2<>""),"SMU","MUJ"))

Dear Friends, I am struggling in converting the above excel function into a dax in Power Bi. Can anyone please help me in writing the dax query from the function above. It would be a great help and learning for me. Thanks in advance.

3 REPLIES 3
adudani
Super User
Super User

hi @murugesh_c ,
kindly provide a sample input and sample output.

 

for now. assuming table name is "Table" and columns are "ColumnA" and "ColumnB"
the measure : 

test = 
IF( 
AND( 'Table'[ColumnA] < 0 , 'Table'[ColumnA] <>"" ), 
"SMU",
IF( 
AND( 'Table'[ColumnA] > 0 , 'Table'[ColumnA] <>"" ), 
"SMU",
"MUJ"
)
)

 

rought this would be it.

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a Kudos 🙂
Kind Regards,
Avinash

Hi Avinash,

Thank you for your time.

I have attached a spreadsheet containing sample data and the calculation that I want to incorporate in Power Bi. I have the same dataset in Power Bi and I want to replicate the calculation in Column E in Power Bi. Kindly check and let me know if you can help with a dax.   

https://docs.google.com/spreadsheets/d/1zTDLvGKpB36nuXg4BK9JMCQWTCFqmr5B/edit?usp=sharing&ouid=11350...

Can anyone please help me with the dax calculation? I have attached a spreadsheet containing sample data and the calculation that I want to incorporate in Power Bi. I have the same dataset in Power Bi and I want to replicate the calculation in Column E in Power Bi. Kindly check and let me know if you can help with a dax.   

https://docs.google.com/spreadsheets/d/1zTDLvGKpB36nuXg4BK9JMCQWTCFqmr5B/edit?usp=sharing&ouid=11350...


Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.