cancel
Showing results for
Did you mean:

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a \$100 discount. Register Now

Helper I

## IF Statemenr Based in 2 column differnt Type

Hi ,

How to Convert This DAX Code to add custom column in power query

Acc Lev 2 = SWITH(TRUE( ),
F0901[GMOBJ] =1101 && F0901[GMSUB] =1000 , "A/R & Others",
F0901[GMOBJ] =1101 && F0901[GMSUB] =2000 ," A/R & Others",
F0901[GMOBJ] =1101 && F0901[GMSUB] =2500 ," A/R & Others",
F0901[GMOBJ]=1101 && F0901[GMSUB]<1000 && F0901[GMOBJ]<1130 ,"Cash&Banks",

Please notes GMOBG Column type Whole Number & GMSUB Column Type Text
1 ACCEPTED SOLUTION
Helper I

Thanks for your replay  and i am so sorry for delay  you   the problem ther is some Account include text  any way i changed  the type

thank you very much

2 REPLIES 2
Helper I

Thanks for your replay  and i am so sorry for delay  you   the problem ther is some Account include text  any way i changed  the type

thank you very much

Community Champion

Hi @Mohammed-

Please change Datatype of the GMSUB text to number in PQ
Then use below formula in Custom Column

``= if [GMOBJ]=1101 and [GMSUB]=1000 then "A/R & Others" else if [GMOBJ]=1101 and [GMSUB]=2000 then "A/R & Others" else if [GMOBJ]=1101 and [GMSUB]=2500 then "A/R & Others" else if [GMOBJ]=1101 and [GMSUB]<1000 and [GMOBJ]<1130 then "Cash&Bank" else null``

Change the logic as per your requirement, I hope you find the logic

Please revert change Datatype of the GMSUB number to text in PQ

If this comment helps you, please THUMBS UP 👍 this comment

Thanks
Pijush

Follow www.MyAccountingTricks.com

Announcements

#### Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

#### Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

#### Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

#### Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors